Repository: groovy
Updated Branches:
  refs/heads/master 7ebeba08d -> ad1591ebb


Fix the test 
gls.generics.GenericsTest.testFriendlyErrorMessageForGenericsArityErrorsGroovy7865


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

Branch: refs/heads/master
Commit: ad1591ebb24b84cd506f625dd1a3a629df0af013
Parents: 7ebeba0
Author: sunlan <sun...@apache.org>
Authored: Sat Aug 5 22:52:35 2017 +0800
Committer: sunlan <sun...@apache.org>
Committed: Sat Aug 5 22:52:35 2017 +0800

----------------------------------------------------------------------
 src/test/gls/generics/GenericsTest.groovy | 30 ++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/ad1591eb/src/test/gls/generics/GenericsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/gls/generics/GenericsTest.groovy 
b/src/test/gls/generics/GenericsTest.groovy
index d08cd0a..91b9567 100644
--- a/src/test/gls/generics/GenericsTest.groovy
+++ b/src/test/gls/generics/GenericsTest.groovy
@@ -18,6 +18,7 @@
  */
 package gls.generics
 
+import org.codehaus.groovy.control.CompilerConfiguration
 import org.codehaus.groovy.control.MultipleCompilationErrorsException
 
 class GenericsTest extends GenericsTestBase {
@@ -476,18 +477,35 @@ import java.util.concurrent.atomic.AtomicInteger
         shouldFailCompilationWithMessages '''
             class MyList extends ArrayList<String, String> {}
         ''', ['(supplied with 2 type parameters)', 'which takes 1 parameter']
-        shouldFailCompilationWithMessages '''
-            class MyList extends ArrayList<> {}
-        ''', ['(supplied with 0 type parameters)', 'which takes 1 parameter', 
'invalid Diamond <> usage?']
+
+        if (CompilerConfiguration.DEFAULT.antlr2Parser) {
+            shouldFailCompilationWithMessages '''
+                class MyList extends ArrayList<> {}
+            ''', ['(supplied with 0 type parameters)', 'which takes 1 
parameter', 'invalid Diamond <> usage?']
+        } else {
+            shouldFailCompilationWithMessages '''
+                class MyList extends ArrayList<> {}
+            ''', ['Unexpected input: \'ArrayList<>\'']
+        }
+
         shouldFailCompilationWithMessages '''
             class MyMap extends HashMap<String> {}
         ''', ['(supplied with 1 type parameter)', 'which takes 2 parameters']
         shouldFailCompilationWithMessages '''
             class MyList implements List<String, String> {}
         ''', ['(supplied with 2 type parameters)', 'which takes 1 parameter']
-        shouldFailCompilationWithMessages '''
-            class MyList implements Map<> {}
-        ''', ['(supplied with 0 type parameters)', 'which takes 2 parameters', 
'invalid Diamond <> usage?']
+
+        if (CompilerConfiguration.DEFAULT.antlr2Parser) {
+            shouldFailCompilationWithMessages '''
+                class MyList implements Map<> {}
+            ''', ['(supplied with 0 type parameters)', 'which takes 2 
parameters', 'invalid Diamond <> usage?']
+        } else {
+            shouldFailCompilationWithMessages '''
+                class MyList implements Map<> {}
+            ''', ['Unexpected input: \'<\'']
+        }
+
+
         shouldFailCompilationWithMessages '''
             class MyMap implements Map<String> {}
         ''', ['(supplied with 1 type parameter)', 'which takes 2 parameters']

Reply via email to