You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/04/11 01:37:55 UTC

[19/50] groovy git commit: Add a test case for GROOVY-4438: Use of an inner enum causes compilation to go into infinite loop

Add a test case for GROOVY-4438: Use of an inner enum causes compilation to go into infinite loop


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/83e26af5
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/83e26af5
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/83e26af5

Branch: refs/heads/master
Commit: 83e26af514f9d349937f110919dd78bdcb62316e
Parents: a8e2874
Author: sunlan <su...@apache.org>
Authored: Wed Jan 25 00:47:58 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Jan 25 00:47:58 2017 +0800

----------------------------------------------------------------------
 .../groovy/parser/antlr4/GroovyParserTest.groovy      | 14 +++++++-------
 .../src/test/resources/bugs/BUG-GROOVY-4438.groovy    |  8 ++++++++
 2 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/83e26af5/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 5b78c40..5cefbf9 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
@@ -328,13 +328,6 @@ class GroovyParserTest extends GroovyTestCase {
         doTest('core/Unicode_01.groovy');
     }
 
-    void "test groovy core - BUG"() {
-        doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
-        doRunAndTest('bugs/GROOVY-3898.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
-    }
-
     void "test groovy core - BreakingChanges"() {
         doRunAndTest('core/BreakingChange_01x.groovy');
         doRunAndTest('core/BreakingChange_02x.groovy');
@@ -346,4 +339,11 @@ class GroovyParserTest extends GroovyTestCase {
         doRunAndTest('core/Array_01x.groovy');
     }
 
+    void "test groovy core - BUG"() {
+        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');
+    }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/83e26af5/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
new file mode 100644
index 0000000..c62dfec
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
@@ -0,0 +1,8 @@
+enum Outer {
+    A, B
+    enum Inner{X, Y}
+}
+assert Outer.A instanceof Outer
+assert Outer.B instanceof Outer
+assert Outer.Inner.X instanceof Outer.Inner
+assert Outer.Inner.Y instanceof Outer.Inner
\ No newline at end of file