| package com.github.javaparser.ast.validator; |
| |
| import com.github.javaparser.JavaParser; |
| import com.github.javaparser.ParseResult; |
| import com.github.javaparser.ParserConfiguration; |
| import com.github.javaparser.ast.stmt.Statement; |
| import org.junit.Test; |
| |
| 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.utils.TestUtils.assertProblems; |
| |
| public class Java1_3ValidatorTest { |
| public static final JavaParser javaParser = new JavaParser(new ParserConfiguration().setLanguageLevel(JAVA_1_3)); |
| |
| @Test |
| public void noAssert() { |
| ParseResult<Statement> result = javaParser.parse(STATEMENT, provider("assert a;")); |
| assertProblems(result, "(line 1,col 1) 'assert' keyword is not supported."); |
| } |
| } |