blob: 4f9af27486c26f73c015e4c3467e4bc3c204f567 [file] [log] [blame]
package com.github.javaparser.version;
import com.github.javaparser.JavaParser;
import com.github.javaparser.ParseResult;
import com.github.javaparser.ParserConfiguration;
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.STATEMENT;
import static com.github.javaparser.ParserConfiguration.LanguageLevel.JAVA_10;
import static com.github.javaparser.Providers.provider;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class Java10PostProcessorTest {
public static final JavaParser javaParser = new JavaParser(new ParserConfiguration().setLanguageLevel(JAVA_10));
@Test
public void varIsAType() {
ParseResult<Statement> result = javaParser.parse(STATEMENT, provider("var x=\"\";"));
List<VarType> allVarTypes = result.getResult().get().findAll(VarType.class);
assertEquals(1, allVarTypes.size());
}
}