diff --git a/javaparser-core-testing/src/test/java/com/github/javaparser/JKIssue.java b/javaparser-core-testing/src/test/java/com/github/javaparser/JKIssue.java index 051e377f65..5b66b972a3 100644 --- a/javaparser-core-testing/src/test/java/com/github/javaparser/JKIssue.java +++ b/javaparser-core-testing/src/test/java/com/github/javaparser/JKIssue.java @@ -53,4 +53,14 @@ void test2() throws IOException { var clause = cu.getType(0).getMethods().get(0).getContracts().get(0).getClauses().get(0).asJmlSimpleExprClause(); Assertions.assertEquals(1, clause.getChildNodes().size()); } + + @Test + void test3() throws IOException { + ParserConfiguration cfg = new ParserConfiguration(); + cfg.setProcessJml(true); + JavaParser parser = new JavaParser(cfg); + final var result = parser.parse(Paths.get("src/test/test_sourcecode/JKTmpTest.java")); + result.getProblems().forEach(System.err::println); + Assertions.assertTrue(result.isSuccessful()); + } } diff --git a/javaparser-core-testing/src/test/test_sourcecode/JKTmpTest.java b/javaparser-core-testing/src/test/test_sourcecode/JKTmpTest.java new file mode 100644 index 0000000000..7199bdfef7 --- /dev/null +++ b/javaparser-core-testing/src/test/test_sourcecode/JKTmpTest.java @@ -0,0 +1,8 @@ +public class JKTmpTest { + int[] arr; + + void f() { + for (int i : arr) { + } + } +} \ No newline at end of file