diff options
author | Danny van Bruggen <hexagonaal@gmail.com> | 2018-02-23 20:53:37 +0100 |
---|---|---|
committer | Danny van Bruggen <hexagonaal@gmail.com> | 2018-02-23 20:53:37 +0100 |
commit | f643da5d10fe763e45cce419b57e5b2d4f0dc712 (patch) | |
tree | db2b5d5237f74438c26f6e834f33049d921b6a78 /javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/types/ResolvedPrimitiveTypeTest.java | |
parent | 8e1dfeb3c2c1c651b5b14bd5c5ff155ea8e30bd5 (diff) | |
parent | a1dbf3abc9cc1c0ba8f177f56a2a016cf894083f (diff) | |
download | javaparser-f643da5d10fe763e45cce419b57e5b2d4f0dc712.tar.gz |
Merge remote-tracking branch 'origin/small_things' into small_things
Diffstat (limited to 'javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/types/ResolvedPrimitiveTypeTest.java')
-rw-r--r-- | javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/types/ResolvedPrimitiveTypeTest.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/types/ResolvedPrimitiveTypeTest.java b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/types/ResolvedPrimitiveTypeTest.java new file mode 100644 index 000000000..494b2b2e9 --- /dev/null +++ b/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/resolution/types/ResolvedPrimitiveTypeTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2016 Federico Tomassetti + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.github.javaparser.resolution.types; + +import com.github.javaparser.symbolsolver.resolution.AbstractResolutionTest; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ResolvedPrimitiveTypeTest extends AbstractResolutionTest { + + private String exampleOfSwitch(ResolvedPrimitiveType rpt) { + switch (rpt) { + case INT: + return "I"; + case BYTE: + return "B"; + case DOUBLE: + return "D"; + default: + return "U"; + } + } + + @Test + public void tryTheSwitchStatement() { + assertEquals("U", exampleOfSwitch(ResolvedPrimitiveType.BOOLEAN)); + assertEquals("U", exampleOfSwitch(ResolvedPrimitiveType.CHAR)); + assertEquals("B", exampleOfSwitch(ResolvedPrimitiveType.BYTE)); + assertEquals("U", exampleOfSwitch(ResolvedPrimitiveType.SHORT)); + assertEquals("I", exampleOfSwitch(ResolvedPrimitiveType.INT)); + assertEquals("U", exampleOfSwitch(ResolvedPrimitiveType.LONG)); + assertEquals("U", exampleOfSwitch(ResolvedPrimitiveType.FLOAT)); + assertEquals("D", exampleOfSwitch(ResolvedPrimitiveType.DOUBLE)); + } +} |