Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 30dac3faa -> dd27ab055


Fix the test 
gls.generics.GenericsTest.testFriendlyErrorMessageForGenericsArityErrorsGroovy7865

(cherry picked from commit ad1591e)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: dd27ab055f5cc2cec392bb99868dcbc35cf90a05
Parents: 30dac3f
Author: sunlan <sun...@apache.org>
Authored: Sat Aug 5 22:52:35 2017 +0800
Committer: sunlan <sun...@apache.org>
Committed: Sat Aug 5 22:53:20 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/dd27ab05/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