groovy git commit: Fix the test groovy.transform.stc.GenericsSTCTest.testShouldComplainAboutToInteger
Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 7563053a8 -> 1802e3198 Fix the test groovy.transform.stc.GenericsSTCTest.testShouldComplainAboutToInteger (cherry picked from commit 42f1e6d) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/1802e319 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/1802e319 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/1802e319 Branch: refs/heads/GROOVY_2_6_X Commit: 1802e31988118203b0487abc947a5564f5c0b18f Parents: 7563053 Author: sunlan Authored: Sat Aug 5 21:56:32 2017 +0800 Committer: sunlan Committed: Sat Aug 5 21:57:48 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/1802e319/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() {
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 Authored: Sat Aug 5 21:56:32 2017 +0800 Committer: sunlan 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() {