You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2017/05/05 17:01:04 UTC
groovy git commit: GROOVY-8161: Empty statement before semicolon with
parrot parser
Repository: groovy
Updated Branches:
refs/heads/master 6f41416f2 -> 1a1dbd801
GROOVY-8161: Empty statement before semicolon with parrot parser
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/1a1dbd80
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/1a1dbd80
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/1a1dbd80
Branch: refs/heads/master
Commit: 1a1dbd801a09ea56a4d2a80a148fbee8a753d862
Parents: 6f41416
Author: sunlan <su...@apache.org>
Authored: Sat May 6 01:00:36 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Sat May 6 01:00:36 2017 +0800
----------------------------------------------------------------------
.../apache/groovy/parser/antlr4/AstBuilder.java | 14 +-
.../parser/antlr4/GroovyParserTest.groovy | 312 ++++++++++---------
.../test/resources/bugs/BUG-GROOVY-8161.groovy | 2 +
3 files changed, 172 insertions(+), 156 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/1a1dbd80/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 087c291..e0708f7 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -1285,14 +1285,14 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
this.configureAST(methodNode, ctx);
- validateMethodDeclaration(ctx, methodNode, modifierManager);
+ validateMethodDeclaration(ctx, methodNode, modifierManager, classNode);
groovydocManager.handle(methodNode, ctx);
return methodNode;
}
- private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager) {
+ private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager, ClassNode classNode) {
boolean isAbstractMethod = methodNode.isAbstract();
boolean hasMethodBody = asBoolean(methodNode.getCode());
@@ -1304,6 +1304,11 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
if (!isAbstractMethod && !hasMethodBody) { // non-abstract method without body in the non-script(e.g. class, enum, trait) is not allowed!
throw createParsingFailedException("You defined a method[" + methodNode.getName() + "] without body. Try adding a method body, or declare it abstract", methodNode);
}
+
+ boolean isInterfaceOrAbstractClass = asBoolean(classNode) && classNode.isAbstract() && !classNode.isAnnotationDefinition();
+ if (isInterfaceOrAbstractClass && !modifierManager.contains(DEFAULT) && isAbstractMethod && hasMethodBody) {
+ throw createParsingFailedException("You defined an abstract method[" + methodNode.getName() + "] with body. Try removing the method body" + (classNode.isInterface() ? ", or declare it default" : ""), methodNode);
+ }
}
modifierManager.validate(methodNode);
@@ -3470,11 +3475,12 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
return this.configureAST(
this.createBlockStatement(
ctx.blockStatement().stream()
- .map(this::visitBlockStatement).collect(Collectors.toList())),
+ .map(this::visitBlockStatement)
+ .filter(e -> asBoolean(e))
+ .collect(Collectors.toList())),
ctx);
}
-
@Override
public Statement visitBlockStatement(BlockStatementContext ctx) {
if (asBoolean(ctx.localVariableDeclaration())) {
http://git-wip-us.apache.org/repos/asf/groovy/blob/1a1dbd80/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index 6892237..480d2ab 100644
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -18,11 +18,18 @@
*/
package org.apache.groovy.parser.antlr4
-import org.codehaus.groovy.ast.*
+import org.codehaus.groovy.ast.ClassNode
+import org.codehaus.groovy.ast.FieldNode
+import org.codehaus.groovy.ast.MethodNode
+import org.codehaus.groovy.ast.Parameter
+import org.codehaus.groovy.ast.PropertyNode
import org.codehaus.groovy.ast.stmt.AssertStatement
import org.codehaus.groovy.ast.stmt.ExpressionStatement
import org.codehaus.groovy.syntax.Token
+import static org.apache.groovy.parser.antlr4.TestUtils.doTest
+import static org.apache.groovy.parser.antlr4.TestUtils.doRunAndTest
+
/**
* Some basic test cases for the new parser
*
@@ -36,12 +43,12 @@ class GroovyParserTest extends GroovyTestCase {
void tearDown() {}
void "test groovy core - Comments"() {
- TestUtils.doTest('core/Comments_01.groovy', [ExpressionStatement]);
+ doTest('core/Comments_01.groovy', [ExpressionStatement]);
doTestAttachedComments();
}
private static doTestAttachedComments() {
- def (newAST, oldAST) = TestUtils.doTest('core/Comments_02.groovy');
+ def (newAST, oldAST) = doTest('core/Comments_02.groovy');
List<ClassNode> classes = new ArrayList<>(newAST.classes).sort { c1, c2 -> c1.name <=> c2.name };
List<MethodNode> methods = new ArrayList<>(newAST.methods).sort { m1, m2 -> m1.name <=> m2.name };
@@ -76,285 +83,286 @@ class GroovyParserTest extends GroovyTestCase {
}
void "test groovy core - PackageDeclaration"() {
- TestUtils.doTest('core/PackageDeclaration_01.groovy');
- TestUtils.doTest('core/PackageDeclaration_02.groovy');
- TestUtils.doTest('core/PackageDeclaration_03.groovy');
- TestUtils.doTest('core/PackageDeclaration_04.groovy');
- TestUtils.doTest('core/PackageDeclaration_05.groovy');
- TestUtils.doTest('core/PackageDeclaration_06.groovy');
+ doTest('core/PackageDeclaration_01.groovy');
+ doTest('core/PackageDeclaration_02.groovy');
+ doTest('core/PackageDeclaration_03.groovy');
+ doTest('core/PackageDeclaration_04.groovy');
+ doTest('core/PackageDeclaration_05.groovy');
+ doTest('core/PackageDeclaration_06.groovy');
}
void "test groovy core - ImportDeclaration"() {
- TestUtils.doTest('core/ImportDeclaration_01.groovy');
- TestUtils.doTest('core/ImportDeclaration_02.groovy');
- TestUtils.doTest('core/ImportDeclaration_03.groovy');
- TestUtils.doTest('core/ImportDeclaration_04.groovy');
- TestUtils.doTest('core/ImportDeclaration_05.groovy');
- TestUtils.doTest('core/ImportDeclaration_06.groovy');
- TestUtils.doTest('core/ImportDeclaration_07.groovy');
- TestUtils.doTest('core/ImportDeclaration_08.groovy');
+ doTest('core/ImportDeclaration_01.groovy');
+ doTest('core/ImportDeclaration_02.groovy');
+ doTest('core/ImportDeclaration_03.groovy');
+ doTest('core/ImportDeclaration_04.groovy');
+ doTest('core/ImportDeclaration_05.groovy');
+ doTest('core/ImportDeclaration_06.groovy');
+ doTest('core/ImportDeclaration_07.groovy');
+ doTest('core/ImportDeclaration_08.groovy');
}
void "test groovy core - Annotation"() {
- TestUtils.doTest('core/Annotation_01.groovy');
- TestUtils.doTest('core/Annotation_02.groovy');
- TestUtils.doTest('core/Annotation_03.groovy');
- TestUtils.doTest('core/Annotation_04.groovy');
- TestUtils.doTest('core/Annotation_05.groovy');
- TestUtils.doTest('core/Annotation_06.groovy');
- TestUtils.doTest('core/Annotation_07.groovy');
- TestUtils.doTest('core/Annotation_08.groovy');
- TestUtils.doTest('core/Annotation_09.groovy');
- TestUtils.doRunAndTest('core/Annotation_10x.groovy');
+ doTest('core/Annotation_01.groovy');
+ doTest('core/Annotation_02.groovy');
+ doTest('core/Annotation_03.groovy');
+ doTest('core/Annotation_04.groovy');
+ doTest('core/Annotation_05.groovy');
+ doTest('core/Annotation_06.groovy');
+ doTest('core/Annotation_07.groovy');
+ doTest('core/Annotation_08.groovy');
+ doTest('core/Annotation_09.groovy');
+ doRunAndTest('core/Annotation_10x.groovy');
}
void "test groovy core - Literal"() {
- TestUtils.doTest('core/Literal_01.groovy');
- TestUtils.doTest('core/Literal_02.groovy', [ExpressionStatement]);
- TestUtils.doTest('core/Literal_03.groovy');
+ doTest('core/Literal_01.groovy');
+ doTest('core/Literal_02.groovy', [ExpressionStatement]);
+ doTest('core/Literal_03.groovy');
}
void "test groovy core - GString"() {
- TestUtils.doTest('core/GString_01.groovy');
- TestUtils.doTest('core/GString_02.groovy');
- TestUtils.doTest('core/GString_03.groovy');
- TestUtils.doTest('core/GString_04.groovy');
- TestUtils.doTest('core/GString_05.groovy');
- TestUtils.doTest('core/GString_06.groovy');
+ doTest('core/GString_01.groovy');
+ doTest('core/GString_02.groovy');
+ doTest('core/GString_03.groovy');
+ doTest('core/GString_04.groovy');
+ doTest('core/GString_05.groovy');
+ doTest('core/GString_06.groovy');
}
void "test groovy core - Closure"() {
- TestUtils.doTest('core/Closure_01.groovy');
- TestUtils.doTest('core/Closure_02.groovy');
- TestUtils.doTest('core/Closure_03.groovy');
- TestUtils.doTest('core/Closure_04.groovy');
- TestUtils.doTest('core/Closure_05.groovy', [Parameter]);
- TestUtils.doTest('core/Closure_06.groovy', [Parameter]);
- TestUtils.doTest('core/Closure_07.groovy', [Parameter]);
- TestUtils.doTest('core/Closure_08.groovy', [Parameter]);
- TestUtils.doTest('core/Closure_09.groovy', [Parameter]);
- TestUtils.doTest('core/Closure_10.groovy', [Parameter]);
+ doTest('core/Closure_01.groovy');
+ doTest('core/Closure_02.groovy');
+ doTest('core/Closure_03.groovy');
+ doTest('core/Closure_04.groovy');
+ doTest('core/Closure_05.groovy', [Parameter]);
+ doTest('core/Closure_06.groovy', [Parameter]);
+ doTest('core/Closure_07.groovy', [Parameter]);
+ doTest('core/Closure_08.groovy', [Parameter]);
+ doTest('core/Closure_09.groovy', [Parameter]);
+ doTest('core/Closure_10.groovy', [Parameter]);
}
void "test groovy core - Lambda"() {
- TestUtils.doRunAndTest('core/Lambda_01x.groovy');
+ doRunAndTest('core/Lambda_01x.groovy');
}
void "test groovy core - MethodReference"() {
- TestUtils.doRunAndTest('core/MethodReference_01x.groovy');
+ doRunAndTest('core/MethodReference_01x.groovy');
}
void "test groovy core - MethodPointer"() {
- TestUtils.doRunAndTest('core/MethodPointer_01x.groovy');
+ doRunAndTest('core/MethodPointer_01x.groovy');
}
void "test groovy core - ElvisAssignment"() {
- TestUtils.doRunAndTest('core/ElvisAssignment_01x.groovy');
+ doRunAndTest('core/ElvisAssignment_01x.groovy');
}
void "test groovy core - List"() {
- TestUtils.doTest('core/List_01.groovy');
+ doTest('core/List_01.groovy');
}
void "test groovy core - Map"() {
- TestUtils.doTest('core/Map_01.groovy');
+ doTest('core/Map_01.groovy');
}
void "test groovy core - Expression"() {
- TestUtils.doTest('core/Expression_01.groovy');
- TestUtils.doTest('core/Expression_02.groovy');
- TestUtils.doTest('core/Expression_03.groovy');
- TestUtils.doTest('core/Expression_04.groovy');
- TestUtils.doTest('core/Expression_05.groovy');
- TestUtils.doTest('core/Expression_06.groovy');
- TestUtils.doTest('core/Expression_07.groovy');
- TestUtils.doTest('core/Expression_08.groovy');
- TestUtils.doTest('core/Expression_09.groovy');
- TestUtils.doTest('core/Expression_10.groovy');
- TestUtils.doTest('core/Expression_11.groovy');
- TestUtils.doTest('core/Expression_12.groovy');
- TestUtils.doTest('core/Expression_13.groovy');
- TestUtils.doTest('core/Expression_14.groovy');
- TestUtils.doTest('core/Expression_15.groovy');
- TestUtils.doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
- TestUtils.doTest('core/Expression_17.groovy');
- TestUtils.doTest('core/Expression_18.groovy');
- TestUtils.doTest('core/Expression_19.groovy');
- TestUtils.doTest('core/Expression_20.groovy');
- TestUtils.doRunAndTest('core/Expression_21x.groovy');
- TestUtils.doTest('core/Expression_22x.groovy');
- TestUtils.doRunAndTest('core/Expression_22x.groovy');
- TestUtils.doRunAndTest('core/Expression_23x.groovy');
+ doTest('core/Expression_01.groovy');
+ doTest('core/Expression_02.groovy');
+ doTest('core/Expression_03.groovy');
+ doTest('core/Expression_04.groovy');
+ doTest('core/Expression_05.groovy');
+ doTest('core/Expression_06.groovy');
+ doTest('core/Expression_07.groovy');
+ doTest('core/Expression_08.groovy');
+ doTest('core/Expression_09.groovy');
+ doTest('core/Expression_10.groovy');
+ doTest('core/Expression_11.groovy');
+ doTest('core/Expression_12.groovy');
+ doTest('core/Expression_13.groovy');
+ doTest('core/Expression_14.groovy');
+ doTest('core/Expression_15.groovy');
+ doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
+ doTest('core/Expression_17.groovy');
+ doTest('core/Expression_18.groovy');
+ doTest('core/Expression_19.groovy');
+ doTest('core/Expression_20.groovy');
+ doRunAndTest('core/Expression_21x.groovy');
+ doTest('core/Expression_22x.groovy');
+ doRunAndTest('core/Expression_22x.groovy');
+ doRunAndTest('core/Expression_23x.groovy');
}
void "test groovy core - IdenticalOp"() {
- TestUtils.doRunAndTest('core/IdenticalOp_01x.groovy');
+ doRunAndTest('core/IdenticalOp_01x.groovy');
}
void "test groovy core - Assert"() {
- TestUtils.doTest('core/Assert_01.groovy');
- TestUtils.doRunAndTest('core/Assert_02x.groovy');
- TestUtils.doRunAndTest('core/Assert_03x.groovy');
+ doTest('core/Assert_01.groovy');
+ doRunAndTest('core/Assert_02x.groovy');
+ doRunAndTest('core/Assert_03x.groovy');
}
void "test groovy core - IfElse"() {
- TestUtils.doTest('core/IfElse_01.groovy', [AssertStatement]);
+ doTest('core/IfElse_01.groovy', [AssertStatement]);
}
void "test groovy core - For"() {
- TestUtils.doTest('core/For_01.groovy', [AssertStatement]);
- TestUtils.doTest('core/For_02.groovy');
- TestUtils.doTest('core/For_03.groovy');
- TestUtils.doRunAndTest('core/For_04x.groovy');
- TestUtils.doRunAndTest('core/For_05x.groovy');
+ doTest('core/For_01.groovy', [AssertStatement]);
+ doTest('core/For_02.groovy');
+ doTest('core/For_03.groovy');
+ doRunAndTest('core/For_04x.groovy');
+ doRunAndTest('core/For_05x.groovy');
}
void "test groovy core - While"() {
- TestUtils.doTest('core/While_01.groovy');
- TestUtils.doRunAndTest('core/While_02x.groovy');
+ doTest('core/While_01.groovy');
+ doRunAndTest('core/While_02x.groovy');
}
void "test groovy core - CodeBlock"() {
- TestUtils.doRunAndTest('core/CodeBlock_01x.groovy');
+ doRunAndTest('core/CodeBlock_01x.groovy');
}
void "test groovy core - DoWhile"() {
- TestUtils.doRunAndTest('core/DoWhile_01x.groovy');
- TestUtils.doRunAndTest('core/DoWhile_02x.groovy');
- TestUtils.doRunAndTest('core/DoWhile_03x.groovy');
- TestUtils.doRunAndTest('core/DoWhile_04x.groovy');
+ doRunAndTest('core/DoWhile_01x.groovy');
+ doRunAndTest('core/DoWhile_02x.groovy');
+ doRunAndTest('core/DoWhile_03x.groovy');
+ doRunAndTest('core/DoWhile_04x.groovy');
}
void "test groovy core - TryCatch"() {
- TestUtils.doTest('core/TryCatch_01.groovy');
+ doTest('core/TryCatch_01.groovy');
}
void "test groovy core - TryWithResources"() {
- TestUtils.doRunAndTest('core/TryWithResources_01x.groovy');
+ doRunAndTest('core/TryWithResources_01x.groovy');
}
void "test groovy core - SafeIndex"() {
- TestUtils.doRunAndTest('core/SafeIndex_01x.groovy');
- TestUtils.doRunAndTest('core/SafeIndex_02x.groovy');
- TestUtils.doRunAndTest('core/SafeIndex_03x.groovy');
+ doRunAndTest('core/SafeIndex_01x.groovy');
+ doRunAndTest('core/SafeIndex_02x.groovy');
+ doRunAndTest('core/SafeIndex_03x.groovy');
}
void "test groovy core - NegativeRelationalOperators"() {
- TestUtils.doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
- TestUtils.doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
+ doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
+ doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
}
void "test groovy core - DefaultMethod"() {
- TestUtils.doRunAndTest('core/DefaultMethod_01x.groovy');
- TestUtils.doRunAndTest('core/DefaultMethod_02x.groovy');
+ doRunAndTest('core/DefaultMethod_01x.groovy');
+ doRunAndTest('core/DefaultMethod_02x.groovy');
}
void "test groovy core - Switch"() {
- TestUtils.doTest('core/Switch_01.groovy');
+ doTest('core/Switch_01.groovy');
}
void "test groovy core - Synchronized"() {
- TestUtils.doTest('core/Synchronized_01.groovy');
+ doTest('core/Synchronized_01.groovy');
}
void "test groovy core - Return"() {
- TestUtils.doTest('core/Return_01.groovy');
+ doTest('core/Return_01.groovy');
}
void "test groovy core - Throw"() {
- TestUtils.doTest('core/Throw_01.groovy');
+ doTest('core/Throw_01.groovy');
}
void "test groovy core - Label"() {
- TestUtils.doTest('core/Label_01.groovy');
+ doTest('core/Label_01.groovy');
}
void "test groovy core - LocalVariableDeclaration"() {
- TestUtils.doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
+ doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
}
void "test groovy core - MethodDeclaration"() {
- TestUtils.doTest('core/MethodDeclaration_01.groovy');
- TestUtils.doTest('core/MethodDeclaration_02.groovy');
+ doTest('core/MethodDeclaration_01.groovy');
+ doTest('core/MethodDeclaration_02.groovy');
}
void "test groovy core - ClassDeclaration"() {
- TestUtils.doTest('core/ClassDeclaration_01.groovy');
- TestUtils.doTest('core/ClassDeclaration_02.groovy');
- TestUtils.doTest('core/ClassDeclaration_03.groovy');
- TestUtils.doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
- TestUtils.doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
- TestUtils.doTest('core/ClassDeclaration_06.groovy');
- TestUtils.doTest('core/ClassDeclaration_07.groovy');
+ doTest('core/ClassDeclaration_01.groovy');
+ doTest('core/ClassDeclaration_02.groovy');
+ doTest('core/ClassDeclaration_03.groovy');
+ doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
+ doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
+ doTest('core/ClassDeclaration_06.groovy');
+ doTest('core/ClassDeclaration_07.groovy');
}
void "test groovy core - InterfaceDeclaration"() {
- TestUtils.doTest('core/InterfaceDeclaration_01.groovy');
- TestUtils.doTest('core/InterfaceDeclaration_02.groovy');
- TestUtils.doTest('core/InterfaceDeclaration_03.groovy');
+ doTest('core/InterfaceDeclaration_01.groovy');
+ doTest('core/InterfaceDeclaration_02.groovy');
+ doTest('core/InterfaceDeclaration_03.groovy');
}
void "test groovy core - EnumDeclaration"() {
- TestUtils.doTest('core/EnumDeclaration_01.groovy');
- TestUtils.doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
- TestUtils.doTest('core/EnumDeclaration_03.groovy');
- TestUtils.doTest('core/EnumDeclaration_04.groovy');
- TestUtils.doTest('core/EnumDeclaration_05.groovy');
+ doTest('core/EnumDeclaration_01.groovy');
+ doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
+ doTest('core/EnumDeclaration_03.groovy');
+ doTest('core/EnumDeclaration_04.groovy');
+ doTest('core/EnumDeclaration_05.groovy');
}
void "test groovy core - TraitDeclaration"() {
- TestUtils.doTest('core/TraitDeclaration_01.groovy');
- TestUtils.doTest('core/TraitDeclaration_02.groovy');
- TestUtils.doTest('core/TraitDeclaration_03.groovy');
- TestUtils.doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
- TestUtils.doTest('core/TraitDeclaration_05.groovy');
+ doTest('core/TraitDeclaration_01.groovy');
+ doTest('core/TraitDeclaration_02.groovy');
+ doTest('core/TraitDeclaration_03.groovy');
+ doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
+ doTest('core/TraitDeclaration_05.groovy');
}
void "test groovy core - AnnotationDeclaration"() {
- TestUtils.doTest('core/AnnotationDeclaration_01.groovy');
+ doTest('core/AnnotationDeclaration_01.groovy');
}
void "test groovy core - Command"() {
- TestUtils.doTest('core/Command_01.groovy');
- TestUtils.doTest('core/Command_02.groovy');
- TestUtils.doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
- TestUtils.doTest('core/Command_04.groovy', [ExpressionStatement]);
- TestUtils.doTest('core/Command_05.groovy');
- TestUtils.doRunAndTest('core/Command_06x.groovy')
+ doTest('core/Command_01.groovy');
+ doTest('core/Command_02.groovy');
+ doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
+ doTest('core/Command_04.groovy', [ExpressionStatement]);
+ doTest('core/Command_05.groovy');
+ doRunAndTest('core/Command_06x.groovy')
}
void "test groovy core - Unicode"() {
- TestUtils.doTest('core/Unicode_01.groovy');
+ doTest('core/Unicode_01.groovy');
}
void "test groovy core - BreakingChanges"() {
- TestUtils.doRunAndTest('core/BreakingChange_01x.groovy');
- TestUtils.doRunAndTest('core/BreakingChange_02x.groovy');
- TestUtils.doRunAndTest('core/BreakingChange_03x.groovy');
- TestUtils.doRunAndTest('core/BreakingChange_04x.groovy');
+ doRunAndTest('core/BreakingChange_01x.groovy');
+ doRunAndTest('core/BreakingChange_02x.groovy');
+ doRunAndTest('core/BreakingChange_03x.groovy');
+ doRunAndTest('core/BreakingChange_04x.groovy');
}
void "test groovy core - Array"() {
- TestUtils.doRunAndTest('core/Array_01x.groovy');
+ doRunAndTest('core/Array_01x.groovy');
}
void "test groovy core - Groovydoc"() {
- TestUtils.doRunAndTest('core/Groovydoc_01x.groovy');
+ doRunAndTest('core/Groovydoc_01x.groovy');
}
void "test groovy core - Script"() {
- TestUtils.doRunAndTest('core/Script_01x.groovy');
+ doRunAndTest('core/Script_01x.groovy');
}
void "test groovy core - BUG"() {
- TestUtils.doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
- TestUtils.doRunAndTest('bugs/GROOVY-3898.groovy');
- TestUtils.doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
- TestUtils.doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
- TestUtils.doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
- TestUtils.doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
- TestUtils.doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+ doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
+ doRunAndTest('bugs/GROOVY-3898.groovy');
+ doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
+ doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
+ doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
+ doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
+ doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+ doTest('bugs/BUG-GROOVY-8161.groovy');
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/1a1dbd80/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
new file mode 100644
index 0000000..c7913ed
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
@@ -0,0 +1,2 @@
+for (foo in []) {;
+}
\ No newline at end of file