Skip to content

Commit

Permalink
Test VarType
Browse files Browse the repository at this point in the history
  • Loading branch information
matozoid committed Feb 3, 2018
1 parent d7bb34f commit 427ecca
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -5,23 +5,30 @@
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.*;
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
Expand Down

0 comments on commit 427ecca

Please sign in to comment.