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/08/05 13:56:44 UTC

groovy git commit: Fix the test groovy.transform.stc.GenericsSTCTest.testShouldComplainAboutToInteger

Repository: groovy
Updated Branches:
  refs/heads/master 45f90c76c -> 42f1e6d8f


Fix the test groovy.transform.stc.GenericsSTCTest.testShouldComplainAboutToInteger


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

Branch: refs/heads/master
Commit: 42f1e6d8fa8b1858d14c7334d3b1e0eec1ce068a
Parents: 45f90c7
Author: sunlan <su...@apache.org>
Authored: Sat Aug 5 21:56:32 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Sat Aug 5 21:56:32 2017 +0800

----------------------------------------------------------------------
 src/test/groovy/transform/stc/GenericsSTCTest.groovy | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/42f1e6d8/src/test/groovy/transform/stc/GenericsSTCTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/transform/stc/GenericsSTCTest.groovy b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
index 9655e05..c65965c 100644
--- a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
@@ -434,7 +434,9 @@ class GenericsSTCTest extends StaticTypeCheckingTestCase {
     }
 
     void testShouldComplainAboutToInteger() {
-        shouldFailWithMessages '''
+        boolean isAntlr2Parser = config.isAntlr2Parser()
+
+        String code = '''
             class Test {
                 static test2() {
                     if (new Random().nextBoolean()) {
@@ -455,7 +457,15 @@ class GenericsSTCTest extends StaticTypeCheckingTestCase {
                 }
             }
             new Test()
-        ''', 'Cannot find matching method java.lang.Object#getAt(int)'
+        '''
+
+        if (isAntlr2Parser) {
+            shouldFailWithMessages code, 'Cannot find matching method java.lang.Object#getAt(int)'
+        } else {
+            shouldFailWithMessages code,
+                    'Cannot find matching method java.lang.Object#getAt(int)',
+                    'Cannot find matching method java.lang.Object#toInteger()'
+        }
     }
 
     void testAssignmentOfNewInstance() {