From 427ecca0f2cfb07a81cc6ed0ec6801c631b9d7bc Mon Sep 17 00:00:00 2001 From: Danny van Bruggen Date: Sat, 3 Feb 2018 23:22:43 +0100 Subject: [PATCH] Test VarType --- .../github/javaparser/version/Java10ProcessorTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 6ebb89cfb5..7445334d4d 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.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.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 = javaParser.parse(STATEMENT, provider("var x=\"\";")); + ParseResult result = javaParser.parse(STATEMENT, provider("var x=\"\";")); + + List allVarTypes = result.getResult().get().findAll(VarType.class); + assertEquals(1, allVarTypes.size()); } @Test