diff options
-rw-r--r-- | javaparser-testing/src/test/java/com/github/javaparser/version/Java10ProcessorTest.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/javaparser-testing/src/test/java/com/github/javaparser/version/Java10ProcessorTest.java b/javaparser-testing/src/test/java/com/github/javaparser/version/Java10ProcessorTest.java index 6ebb89cfb..7445334d4 100644 --- a/javaparser-testing/src/test/java/com/github/javaparser/version/Java10ProcessorTest.java +++ b/javaparser-testing/src/test/java/com/github/javaparser/version/Java10ProcessorTest.java @@ -5,8 +5,11 @@ import com.github.javaparser.ParseResult; import com.github.javaparser.ParserConfiguration; import com.github.javaparser.ast.CompilationUnit; import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.ast.type.VarType; import org.junit.Test; +import java.util.List; + import static com.github.javaparser.ParseStart.COMPILATION_UNIT; import static com.github.javaparser.ParseStart.STATEMENT; import static com.github.javaparser.ParserConfiguration.LanguageLevel.*; @@ -14,14 +17,18 @@ import static com.github.javaparser.Providers.provider; import static com.github.javaparser.ast.validator.Java1_1ValidatorTest.allModifiers; import static com.github.javaparser.utils.TestUtils.assertNoProblems; import static com.github.javaparser.utils.TestUtils.assertProblems; +import static org.junit.jupiter.api.Assertions.assertEquals; public class Java10ProcessorTest { public static final JavaParser javaParser = new JavaParser(new ParserConfiguration().setLanguageLevel(JAVA_10)); @Test public void varIsAType() { - ParseResult<Statement> statement = javaParser.parse(STATEMENT, provider("var x=\"\";")); + ParseResult<Statement> result = javaParser.parse(STATEMENT, provider("var x=\"\";")); + + List<VarType> allVarTypes = result.getResult().get().findAll(VarType.class); + assertEquals(1, allVarTypes.size()); } @Test |