This is an automated email from the ASF dual-hosted git repository. emilles pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/groovy.git
commit a036a48d230b39370e970027db01906ad758922d Author: Eric Milles <[email protected]> AuthorDate: Fri Mar 20 17:55:27 2026 -0500 junit jupiter --- .../{Groovy3716Bug.groovy => Groovy3716.groovy} | 10 +- .../{Groovy3718Bug.groovy => Groovy3718.groovy} | 2 +- src/test/groovy/bugs/Groovy3719.groovy | 4 +- .../{Groovy3720Bug.groovy => Groovy3720.groovy} | 23 +++-- .../{Groovy3721Bug.groovy => Groovy3721.groovy} | 10 +- .../{Groovy3723Bug.groovy => Groovy3723.groovy} | 6 +- .../{Groovy3726Bug.groovy => Groovy3726.groovy} | 15 +-- .../{Groovy3749Bug.groovy => Groovy3749.groovy} | 101 ++++++++------------- .../{Groovy3768Bug.groovy => Groovy3768.groovy} | 19 ++-- .../{Groovy3770Bug.groovy => Groovy3770.groovy} | 14 +-- .../{Groovy3827Bug.groovy => Groovy3776.groovy} | 27 +++--- src/test/groovy/bugs/Groovy3776Bug.groovy | 49 ---------- .../{Groovy3784Bug.groovy => Groovy3784.groovy} | 26 +++--- .../{Groovy3799Bug.groovy => Groovy3799.groovy} | 2 +- .../{Groovy3801Bug.groovy => Groovy3801.groovy} | 20 ++-- .../{Groovy3817Bug.groovy => Groovy3817.groovy} | 20 ++-- .../{Groovy3818Bug.groovy => Groovy3818.groovy} | 14 +-- .../{Groovy3827Bug.groovy => Groovy3827.groovy} | 21 +++-- .../{Groovy3830Bug.groovy => Groovy3830.groovy} | 45 +++++---- .../{Groovy3831Bug.groovy => Groovy3831.groovy} | 42 ++++----- .../{Groovy3834Bug.groovy => Groovy3834.groovy} | 7 +- src/test/groovy/bugs/Groovy3839.groovy | 2 - src/test/groovy/bugs/Groovy3852.groovy | 49 ++++------ .../{Groovy3857Bug.groovy => Groovy3857.groovy} | 8 +- .../{Groovy3863Bug.groovy => Groovy3863.groovy} | 6 +- .../{Groovy3868Bug.groovy => Groovy3868.groovy} | 7 +- src/test/groovy/bugs/Groovy3871.groovy | 10 +- .../{Groovy3876Bug.groovy => Groovy3876.groovy} | 16 ++-- .../{Groovy389_Bug.groovy => Groovy389.groovy} | 23 ++--- .../{Groovy3949Bug.groovy => Groovy3894.groovy} | 18 ++-- src/test/groovy/bugs/Groovy3894Bug.groovy | 43 --------- src/test/groovy/bugs/Groovy3904.groovy | 3 +- .../{Groovy3948Bug.groovy => Groovy3948.groovy} | 3 +- .../{Groovy3949Bug.groovy => Groovy3949.groovy} | 14 +-- .../{Groovy3989Bug.groovy => Groovy3989.groovy} | 6 +- 35 files changed, 278 insertions(+), 407 deletions(-) diff --git a/src/test/groovy/bugs/Groovy3716Bug.groovy b/src/test/groovy/bugs/Groovy3716.groovy similarity index 72% rename from src/test/groovy/bugs/Groovy3716Bug.groovy rename to src/test/groovy/bugs/Groovy3716.groovy index 74e0b41c69..e2ea04d837 100644 --- a/src/test/groovy/bugs/Groovy3716Bug.groovy +++ b/src/test/groovy/bugs/Groovy3716.groovy @@ -21,14 +21,12 @@ package bugs import org.codehaus.groovy.ast.ClassHelper import org.junit.jupiter.api.Test -import static org.junit.jupiter.api.Assertions.assertFalse -import static org.junit.jupiter.api.Assertions.assertTrue +final class Groovy3716 { -class Groovy3716Bug { @Test void testVoidAndObjectDerivedFromResults() { - assertTrue ClassHelper.VOID_TYPE.isDerivedFrom(ClassHelper.VOID_TYPE) - assertFalse ClassHelper.OBJECT_TYPE.isDerivedFrom(ClassHelper.VOID_TYPE) - assertFalse ClassHelper.VOID_TYPE.isDerivedFrom(ClassHelper.OBJECT_TYPE) + assert ClassHelper. VOID_TYPE.isDerivedFrom(ClassHelper. VOID_TYPE) + assert !ClassHelper.OBJECT_TYPE.isDerivedFrom(ClassHelper. VOID_TYPE) + assert !ClassHelper. VOID_TYPE.isDerivedFrom(ClassHelper.OBJECT_TYPE) } } diff --git a/src/test/groovy/bugs/Groovy3718Bug.groovy b/src/test/groovy/bugs/Groovy3718.groovy similarity index 97% rename from src/test/groovy/bugs/Groovy3718Bug.groovy rename to src/test/groovy/bugs/Groovy3718.groovy index 8f85a39354..daae15ffc5 100644 --- a/src/test/groovy/bugs/Groovy3718Bug.groovy +++ b/src/test/groovy/bugs/Groovy3718.groovy @@ -22,8 +22,8 @@ import org.junit.jupiter.api.Test import static org.junit.jupiter.api.Assertions.assertFalse +final class Groovy3718 { -class Groovy3718Bug { @Test void testPatternMatchOfNull() { assertFalse null ==~ /[^0-9]+/ diff --git a/src/test/groovy/bugs/Groovy3719.groovy b/src/test/groovy/bugs/Groovy3719.groovy index 7b74121e37..13f08e086b 100644 --- a/src/test/groovy/bugs/Groovy3719.groovy +++ b/src/test/groovy/bugs/Groovy3719.groovy @@ -26,11 +26,9 @@ final class Groovy3719 { @Test void testScriptThrowingNoSuchMethodException() { - def err = shouldFail ''' + shouldFail NoSuchMethodException, ''' println "YES I CAN!" throw new NoSuchMethodException() ''' - - assert err instanceof NoSuchMethodException } } diff --git a/src/test/groovy/bugs/Groovy3720Bug.groovy b/src/test/groovy/bugs/Groovy3720.groovy similarity index 87% rename from src/test/groovy/bugs/Groovy3720Bug.groovy rename to src/test/groovy/bugs/Groovy3720.groovy index 5b438eb6bd..67b7e37703 100644 --- a/src/test/groovy/bugs/Groovy3720Bug.groovy +++ b/src/test/groovy/bugs/Groovy3720.groovy @@ -20,10 +20,13 @@ package bugs import groovy.mock.interceptor.MockFor import groovy.mock.interceptor.StubFor +import org.junit.jupiter.api.Test import static org.junit.jupiter.api.Assertions.assertNotNull -class Groovy3720Bug { +final class Groovy3720 { + + @Test void testCreateStubNode() { def stubNodeContext1 = new StubFor(AnotherNode3720) assertNotNull stubNodeContext1.proxyInstance() @@ -32,6 +35,7 @@ class Groovy3720Bug { assertNotNull stubNodeContext2.proxyInstance() } + @Test void testCreateStubNodeDelegate() { def stubNodeContext1 = new StubFor(AnotherNode3720) assertNotNull stubNodeContext1.proxyDelegateInstance() @@ -40,6 +44,7 @@ class Groovy3720Bug { assertNotNull stubNodeContext2.proxyDelegateInstance() } + @Test void testCreateMockNode() { def mockNodeContext1 = new MockFor(AnotherNode3720) assertNotNull mockNodeContext1.proxyInstance() @@ -48,6 +53,7 @@ class Groovy3720Bug { assertNotNull mockNodeContext2.proxyInstance() } + @Test void testCreateMockNodeDelegate() { def mockNodeContext1 = new MockFor(AnotherNode3720) assertNotNull mockNodeContext1.proxyDelegateInstance() @@ -55,14 +61,15 @@ class Groovy3720Bug { def mockNodeContext2 = new MockFor(MyNode3720) assertNotNull mockNodeContext2.proxyDelegateInstance() } -} -abstract class MyNode3720 {} + abstract static class MyNode3720 { + } -abstract class BaseNode3720 { - abstract m1() -} + abstract static class BaseNode3720 { + abstract m1() + } -abstract class AnotherNode3720 extends BaseNode3720 { - abstract m2() + abstract static class AnotherNode3720 extends BaseNode3720 { + abstract m2() + } } diff --git a/src/test/groovy/bugs/Groovy3721Bug.groovy b/src/test/groovy/bugs/Groovy3721.groovy similarity index 89% rename from src/test/groovy/bugs/Groovy3721Bug.groovy rename to src/test/groovy/bugs/Groovy3721.groovy index 07d30f278c..89a667d740 100644 --- a/src/test/groovy/bugs/Groovy3721Bug.groovy +++ b/src/test/groovy/bugs/Groovy3721.groovy @@ -21,22 +21,22 @@ package bugs import gls.CompilableTestSupport import org.junit.jupiter.api.Test -final class Groovy3721Bug extends CompilableTestSupport { +final class Groovy3721 extends CompilableTestSupport { @Test void testCompilationWithDuplicateJavaBeanProperties() { - shouldNotCompile """ + shouldNotCompile ''' class Foo3721V1 { def F = 1 def f = 2 } - """ - shouldNotCompile """ + ''' + shouldNotCompile ''' class Foo3721V2 { def f = 0 def a = 1 def F = 2 } - """ + ''' } } diff --git a/src/test/groovy/bugs/Groovy3723Bug.groovy b/src/test/groovy/bugs/Groovy3723.groovy similarity index 96% rename from src/test/groovy/bugs/Groovy3723Bug.groovy rename to src/test/groovy/bugs/Groovy3723.groovy index cf1d778a9e..a22f8920a5 100644 --- a/src/test/groovy/bugs/Groovy3723Bug.groovy +++ b/src/test/groovy/bugs/Groovy3723.groovy @@ -22,11 +22,11 @@ import org.junit.jupiter.api.Test import static groovy.test.GroovyAssert.assertScript +final class Groovy3723 { -class Groovy3723Bug { @Test void testEMCPropertyAccessWitGetPropertySetProperty() { - assertScript """ + assertScript ''' class Dummy3723 {} Dummy3723.metaClass.id = 1 @@ -46,6 +46,6 @@ class Groovy3723Bug { d.id = 123 // was failing with groovy.lang.GroovyRuntimeException: Cannot read write-only property: id assert d.id, 123 - """ + ''' } } diff --git a/src/test/groovy/bugs/Groovy3726Bug.groovy b/src/test/groovy/bugs/Groovy3726.groovy similarity index 91% rename from src/test/groovy/bugs/Groovy3726Bug.groovy rename to src/test/groovy/bugs/Groovy3726.groovy index 1fe00c9f89..5d20641414 100644 --- a/src/test/groovy/bugs/Groovy3726Bug.groovy +++ b/src/test/groovy/bugs/Groovy3726.groovy @@ -24,17 +24,18 @@ import java.lang.reflect.Modifier import static org.junit.jupiter.api.Assertions.assertFalse -class Groovy3726Bug { +final class Groovy3726 { + @Test void testVolatilePropertiesResultingInBridgeMethods() { def scriptStr, clazz, fooGetter, fooSetter GroovyClassLoader cl = new GroovyClassLoader(); - scriptStr = """ + scriptStr = ''' public class GroovyBean3726B { - volatile String foo = "anything" + volatile String foo = 'anything' } - """ + ''' clazz = cl.parseClass(scriptStr, 'GroovyBean3726B.groovy') fooGetter = clazz.getMethod('getFoo') @@ -51,11 +52,11 @@ class Groovy3726Bug { def scriptStr, clazz, barGetter, barSetter GroovyClassLoader cl = new GroovyClassLoader(); - scriptStr = """ + scriptStr = ''' public class GroovyBean3726D { - transient String bar = "anything" + transient String bar = 'anything' } - """ + ''' clazz = cl.parseClass(scriptStr, 'GroovyBean3726D.groovy') barGetter = clazz.getMethod('getBar') diff --git a/src/test/groovy/bugs/Groovy3749Bug.groovy b/src/test/groovy/bugs/Groovy3749.groovy similarity index 56% rename from src/test/groovy/bugs/Groovy3749Bug.groovy rename to src/test/groovy/bugs/Groovy3749.groovy index 9f3e09ca68..3ba9e748fb 100644 --- a/src/test/groovy/bugs/Groovy3749Bug.groovy +++ b/src/test/groovy/bugs/Groovy3749.groovy @@ -20,125 +20,102 @@ package bugs import org.junit.jupiter.api.Test -import static groovy.test.GroovyAssert.fail +import static groovy.test.GroovyAssert.assertScript +import static groovy.test.GroovyAssert.shouldFail -class Groovy3749Bug { +final class Groovy3749 { + + /** + * Test various signatures of static main() + */ @Test void testScriptsProvidingStaticMainMethod() { - def scriptStr - - // test various signatures of static main() - scriptStr = """ + shouldFail RuntimeException, ''' static main(args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - scriptStr = """ + shouldFail RuntimeException, ''' static def main(args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - scriptStr = """ + shouldFail RuntimeException, ''' static void main(args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - scriptStr = """ + shouldFail RuntimeException, ''' static main(String[] args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - scriptStr = """ + shouldFail RuntimeException, ''' static def main(String[] args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - scriptStr = """ + shouldFail RuntimeException, ''' static void main(String[] args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - // if both main() and the loose statements are provided, then the loose statements should run and not main - scriptStr = """ + def err = shouldFail ''' static main(args) { throw new RuntimeException('main called') } throw new Error() - """ - assertScriptFails(scriptStr, "Error") + ''' + assert err.message.contains('The method public static void main(java.lang.String[] args) { ... } is a duplicate of the one declared for this script\'s body code') - scriptStr = """ + shouldFail RuntimeException, ''' static void main() { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' // if param type doesn't match, this main won't execute - runScript """ - static main(Date args) { + assertScript ''' + static main(Date date) { throw new RuntimeException('main called') } - """ + ''' } + /** + * Test various signatures of non-static main() + */ @Test void testScriptsProvidingInstanceMainMethod() { - def scriptStr - - // test various signatures of instance main() - scriptStr = """ + shouldFail RuntimeException, ''' def main(String[] args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - scriptStr = """ + shouldFail RuntimeException, ''' void main(args) { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' - scriptStr = """ + shouldFail RuntimeException, ''' void main() { throw new RuntimeException('main called') } - """ - assertScriptFails(scriptStr, "RuntimeException") + ''' // if param type doesn't match, this main won't execute - runScript """ - def main(Date args) { + assertScript ''' + def main(Date date) { throw new RuntimeException('main called') } - """ - } - - static void assertScriptFails(scriptText, expectedFailure) { - try { - runScript(scriptText) - } catch (Throwable ex) { - assert ex.class.name.contains(expectedFailure) - return - } - fail("Expected script to fail with '$expectedFailure' but passed.") - } - - private static void runScript(String scriptText) { - new GroovyShell().run(scriptText, 'Groovy3749Snippet', [] as String[]) + ''' } } diff --git a/src/test/groovy/bugs/Groovy3768Bug.groovy b/src/test/groovy/bugs/Groovy3768.groovy similarity index 85% rename from src/test/groovy/bugs/Groovy3768Bug.groovy rename to src/test/groovy/bugs/Groovy3768.groovy index 49b715e50c..ab1597ddae 100644 --- a/src/test/groovy/bugs/Groovy3768Bug.groovy +++ b/src/test/groovy/bugs/Groovy3768.groovy @@ -21,33 +21,32 @@ package bugs import gls.CompilableTestSupport import org.junit.jupiter.api.Test -final class Groovy3768Bug extends CompilableTestSupport { +final class Groovy3768 extends CompilableTestSupport { @Test void testLocalVariableMarkedStatic() { - - shouldNotCompile """ + shouldNotCompile ''' static int x = 3 - """ + ''' - shouldNotCompile """ + shouldNotCompile ''' def m() { static int x = 3 } - """ + ''' - shouldNotCompile """ + shouldNotCompile ''' class G3768A { def m() { static int x = 3 } } - """ + ''' - shouldCompile """ + shouldCompile ''' class G3768B { static int x = 3 } - """ + ''' } } diff --git a/src/test/groovy/bugs/Groovy3770Bug.groovy b/src/test/groovy/bugs/Groovy3770.groovy similarity index 86% rename from src/test/groovy/bugs/Groovy3770Bug.groovy rename to src/test/groovy/bugs/Groovy3770.groovy index 452f1c279b..d66ecf4ee2 100644 --- a/src/test/groovy/bugs/Groovy3770Bug.groovy +++ b/src/test/groovy/bugs/Groovy3770.groovy @@ -22,20 +22,20 @@ import org.junit.jupiter.api.Test import static groovy.test.GroovyAssert.assertScript +final class Groovy3770 { -class Groovy3770Bug { @Test void testSetDelegateAndResolveStrategyOnACurriedClosure() { - assertScript """ + assertScript ''' void hello(who) { - println ("Hello " + who) + println ('Hello ' + who) } def c = { x -> hello(x) } - def d = c.curry("Ian") + def d = c.curry('Ian') d.call() d.delegate = null @@ -46,16 +46,16 @@ class Groovy3770Bug { try { d.call() - throw new RuntimeException("The curried closure call should have failed here with MME") + throw new RuntimeException('The curried closure call should have failed here with MME') } catch(MissingMethodException ex) { // ok if closure call returned in an exception (MME) } - """ + ''' } + // GROOVY-3875 @Test void testCurriedClosuresShouldNotAffectParent() { - // GROOVY-3875 def orig = { tmp -> assert tmp == 1 } def curriedOrig = orig.curry(1) assert orig != curriedOrig.getOwner() diff --git a/src/test/groovy/bugs/Groovy3827Bug.groovy b/src/test/groovy/bugs/Groovy3776.groovy similarity index 65% copy from src/test/groovy/bugs/Groovy3827Bug.groovy copy to src/test/groovy/bugs/Groovy3776.groovy index fef55ee451..fddfea8241 100644 --- a/src/test/groovy/bugs/Groovy3827Bug.groovy +++ b/src/test/groovy/bugs/Groovy3776.groovy @@ -21,20 +21,23 @@ package bugs import org.codehaus.groovy.control.MultipleCompilationErrorsException import org.junit.jupiter.api.Test -class Groovy3827Bug { - @Test - void testDuplicateCompilationErrorOnProperty() { - GroovyClassLoader cl = new GroovyClassLoader(); +import static groovy.test.GroovyAssert.shouldFail + +final class Groovy3776 { - def scriptStr = """ - class NewGroovyClass { - Test x + @Test + void testInvalidListWithMapEntryExpressions() { + try (GroovyClassLoader gcl = new GroovyClassLoader()) { + shouldFail(MultipleCompilationErrorsException) { + gcl.parseClass ''' + class InvalidListLiteral { + def x = [ + [foo: 1, bar: 2] + [foo: 1, bar: 2] + ] + } + ''' } - """ - try { - cl.parseClass(scriptStr) - } catch(MultipleCompilationErrorsException mcee) { - assert mcee.errorCollector.errors.size() == 1 } } } diff --git a/src/test/groovy/bugs/Groovy3776Bug.groovy b/src/test/groovy/bugs/Groovy3776Bug.groovy deleted file mode 100644 index 299c3374e1..0000000000 --- a/src/test/groovy/bugs/Groovy3776Bug.groovy +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package bugs - -import org.codehaus.groovy.GroovyBugError -import org.codehaus.groovy.control.MultipleCompilationErrorsException -import org.junit.jupiter.api.Test - -import static org.junit.jupiter.api.Assertions.fail - -class Groovy3776Bug { - @Test - void testInvalidListWithMapEntryExpressions() { - GroovyClassLoader cl = new GroovyClassLoader(); - - def scriptStr = """ - class InvalidListLiteral { - def x = [ - [foo: 1, bar: 2] - [foo: 1, bar: 2] - ] - } - """ - try { - cl.parseClass(scriptStr) - fail('Compilation should have failed with MultipleCompilationErrorsException') - } catch(MultipleCompilationErrorsException mcee) { - // ok if failed with this error. - } catch(GroovyBugError gbe) { - fail('Compilation should have failed with MultipleCompilationErrorsException but failed with GroovyBugError') - } - } -} diff --git a/src/test/groovy/bugs/Groovy3784Bug.groovy b/src/test/groovy/bugs/Groovy3784.groovy similarity index 73% rename from src/test/groovy/bugs/Groovy3784Bug.groovy rename to src/test/groovy/bugs/Groovy3784.groovy index d7e0b7e900..1bde3009b4 100644 --- a/src/test/groovy/bugs/Groovy3784Bug.groovy +++ b/src/test/groovy/bugs/Groovy3784.groovy @@ -20,22 +20,22 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3784 { -class Groovy3784Bug { @Test void testUseOfDelegateAndThenGenericsSharingTheSameClassHelper() { - GroovyClassLoader gcl = new GroovyClassLoader() + try (GroovyClassLoader gcl = new GroovyClassLoader()) { + gcl.parseClass ''' + class A { + @Delegate List a + } + ''' - gcl.parseClass """ - class A { - @Delegate List a - } - """ - - gcl.parseClass """ - class B { - List<String> a - } - """ + gcl.parseClass ''' + class B { + List<String> a + } + ''' + } } } diff --git a/src/test/groovy/bugs/Groovy3799Bug.groovy b/src/test/groovy/bugs/Groovy3799.groovy similarity index 98% rename from src/test/groovy/bugs/Groovy3799Bug.groovy rename to src/test/groovy/bugs/Groovy3799.groovy index d7c7db2cfb..7d4b33dda9 100644 --- a/src/test/groovy/bugs/Groovy3799Bug.groovy +++ b/src/test/groovy/bugs/Groovy3799.groovy @@ -20,8 +20,8 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3799 { -class Groovy37XXBug { @Test void testVarArgsWithAnInterfaceAsVarArgArrayTypeWithInheritenceInArgs() { def obj diff --git a/src/test/groovy/bugs/Groovy3801Bug.groovy b/src/test/groovy/bugs/Groovy3801.groovy similarity index 86% rename from src/test/groovy/bugs/Groovy3801Bug.groovy rename to src/test/groovy/bugs/Groovy3801.groovy index 4be713753b..54df240fd6 100644 --- a/src/test/groovy/bugs/Groovy3801Bug.groovy +++ b/src/test/groovy/bugs/Groovy3801.groovy @@ -20,37 +20,37 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3801 { -class Groovy3801Bug { @Test void testMainMethodSignature() { def gcl = new GroovyClassLoader() def clazz - clazz = gcl.parseClass( """ + clazz = gcl.parseClass ''' class Groovy3801A { static main(args) {} } - """, 'Groovy3801A.groovy' - ) + ''', 'Groovy3801A.groovy' + def stdMainMethod = clazz.getMethods().find {it.name == 'main'} assert stdMainMethod.returnType.toString().contains('void') - clazz = gcl.parseClass( """ + clazz = gcl.parseClass ''' class Groovy3801B { static def main(args) {} } - """, 'Groovy3801B.groovy' - ) + ''', 'Groovy3801B.groovy' + stdMainMethod = clazz.getMethods().find {it.name == 'main'} assert stdMainMethod.returnType.toString().contains('void') - clazz = gcl.parseClass( """ + clazz = gcl.parseClass ''' class Groovy3801C { static main() {} } - """, 'Groovy3801C.groovy' - ) + ''', 'Groovy3801C.groovy' + def nonStdMainMethod = clazz.getMethods().find {it.name == 'main'} assert nonStdMainMethod.returnType.toString().contains('java.lang.Object') } diff --git a/src/test/groovy/bugs/Groovy3817Bug.groovy b/src/test/groovy/bugs/Groovy3817.groovy similarity index 80% rename from src/test/groovy/bugs/Groovy3817Bug.groovy rename to src/test/groovy/bugs/Groovy3817.groovy index 165805b71e..8d9017b584 100644 --- a/src/test/groovy/bugs/Groovy3817Bug.groovy +++ b/src/test/groovy/bugs/Groovy3817.groovy @@ -21,27 +21,27 @@ package bugs import gls.CompilableTestSupport import org.junit.jupiter.api.Test -final class Groovy3817Bug extends CompilableTestSupport { +final class Groovy3817 extends CompilableTestSupport { @Test void testUsageOfRangeExpressionJustAfterTryCatch() { - shouldCompile """ - try { println "nix" } + shouldCompile ''' + try { println 'nix' } catch ( Exception e ) { e.printStackTrace() } (1..10).each{ print it } - """ + ''' - shouldCompile """ - try { println "nix" } + shouldCompile ''' + try { println 'nix' } catch ( Exception e ) { e.printStackTrace() } (1..10).each{ print it } - """ + ''' - shouldCompile """ - try { println "nix" } catch ( Exception e ) { e.printStackTrace() } + shouldCompile ''' + try { println 'nix' } catch ( Exception e ) { e.printStackTrace() } (1..10).each{ print it } - """ + ''' } } diff --git a/src/test/groovy/bugs/Groovy3818Bug.groovy b/src/test/groovy/bugs/Groovy3818.groovy similarity index 81% rename from src/test/groovy/bugs/Groovy3818Bug.groovy rename to src/test/groovy/bugs/Groovy3818.groovy index 744db47066..f56a292905 100644 --- a/src/test/groovy/bugs/Groovy3818Bug.groovy +++ b/src/test/groovy/bugs/Groovy3818.groovy @@ -20,17 +20,17 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3818 { -class Groovy3818Bug { @Test void testCreatingSimilarSetandMapWithComparator() { def scompare = { a, b -> a.id <=> b.id } as Comparator def set = new TreeSet( scompare ) - set << [name: "Han Solo", id: 1] - set << [name: "Luke Skywalker", id: 2] - set << [name: "L. Skywalker", id: 3] + set << [name: 'Han Solo', id: 1] + set << [name: 'Luke Skywalker', id: 2] + set << [name: 'L. Skywalker', id: 3] def result = set.findAll { elt -> elt.name =~ /Sky/ } assert result.size() == 2 @@ -42,9 +42,9 @@ class Groovy3818Bug { def map = new TreeMap( mcompare ) - map[[name: "Han Solo", id: 1]] = "Dummy" - map[[name: "Luke Skywalker", id: 2]] = "Dummy" - map[[name: "L. Skywalker", id: 3]] = "Dummy" + map[[name: 'Han Solo', id: 1]] = 'Dummy' + map[[name: 'Luke Skywalker', id: 2]] = 'Dummy' + map[[name: 'L. Skywalker', id: 3]] = 'Dummy' result = map.findAll { elt ->elt.key.name =~ /Sky/ } assert result.size() == 2 diff --git a/src/test/groovy/bugs/Groovy3827Bug.groovy b/src/test/groovy/bugs/Groovy3827.groovy similarity index 75% rename from src/test/groovy/bugs/Groovy3827Bug.groovy rename to src/test/groovy/bugs/Groovy3827.groovy index fef55ee451..4352b18366 100644 --- a/src/test/groovy/bugs/Groovy3827Bug.groovy +++ b/src/test/groovy/bugs/Groovy3827.groovy @@ -21,19 +21,20 @@ package bugs import org.codehaus.groovy.control.MultipleCompilationErrorsException import org.junit.jupiter.api.Test -class Groovy3827Bug { +import static groovy.test.GroovyAssert.shouldFail + +final class Groovy3827 { + @Test void testDuplicateCompilationErrorOnProperty() { - GroovyClassLoader cl = new GroovyClassLoader(); - - def scriptStr = """ - class NewGroovyClass { - Test x + try (GroovyClassLoader gcl = new GroovyClassLoader()) { + def mcee = shouldFail(MultipleCompilationErrorsException) { + gcl.parseClass ''' + class NewGroovyClass { + Test x + } + ''' } - """ - try { - cl.parseClass(scriptStr) - } catch(MultipleCompilationErrorsException mcee) { assert mcee.errorCollector.errors.size() == 1 } } diff --git a/src/test/groovy/bugs/Groovy3830Bug.groovy b/src/test/groovy/bugs/Groovy3830.groovy similarity index 70% rename from src/test/groovy/bugs/Groovy3830Bug.groovy rename to src/test/groovy/bugs/Groovy3830.groovy index d79c6c67d6..0e57cf473f 100644 --- a/src/test/groovy/bugs/Groovy3830Bug.groovy +++ b/src/test/groovy/bugs/Groovy3830.groovy @@ -20,8 +20,8 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3830 { -class Groovy3830Bug { @Test void testCallSitesUsageInAnInterface() { assert I3830.i == 2 @@ -44,34 +44,33 @@ class Groovy3830Bug { assert C3830.I3830.I3830_2.i3 == 18 } -} - -interface I3830 { - Integer i = 2 - Integer i2 = i + 3 - Integer i3 = i * 3 -} - -class C3830 { interface I3830 { Integer i = 2 Integer i2 = i + 3 Integer i3 = i * 3 - interface I3830_1 { - // ensure inner class number increments for callsites helper - // anon C3830$I3830$I3830_1$1 and helper C3830$I3830$I3830_1$2 - def x = new Runnable() { - @Override - void run() {} - } - Integer i = 4 - Integer i2 = i + 3 - Integer i3 = i * 3 - } - interface I3830_2 { - Integer i = 6 + } + static class C3830 { + interface I3830 { + Integer i = 2 Integer i2 = i + 3 Integer i3 = i * 3 + interface I3830_1 { + // ensure inner class number increments for callsites helper + // anon C3830$I3830$I3830_1$1 and helper C3830$I3830$I3830_1$2 + def x = new Runnable() { + @Override + void run() { + } + } + Integer i = 4 + Integer i2 = i + 3 + Integer i3 = i * 3 + } + interface I3830_2 { + Integer i = 6 + Integer i2 = i + 3 + Integer i3 = i * 3 + } } } } diff --git a/src/test/groovy/bugs/Groovy3831Bug.groovy b/src/test/groovy/bugs/Groovy3831.groovy similarity index 62% rename from src/test/groovy/bugs/Groovy3831Bug.groovy rename to src/test/groovy/bugs/Groovy3831.groovy index 9843f6bd3e..c6015ea5ee 100644 --- a/src/test/groovy/bugs/Groovy3831Bug.groovy +++ b/src/test/groovy/bugs/Groovy3831.groovy @@ -20,40 +20,40 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3831 { -class Groovy3831Bug { @Test - void testClosureDefinitionInSpecialCallsInConstructorsV1() { - def test = new Test3831V1('hello', ["world"]) + void testClosureDefinitionInSpecialCallsInConstructors1() { + def test = new Test3831V1('hello', ['world']) assert test.string == 'hello' assert test.uris.size() == 1 } @Test - void testClosureDefinitionInSpecialCallsInConstructorsV2() { - // just loading of class is test enough as it was giving VerifyError earlier. + void testClosureDefinitionInSpecialCallsInConstructors2() { + // just loading of class is test enough as it was giving VerifyError earlier new Test3831V2() } -} -class Test3831V1 { - String string - URI[] uris + static class Test3831V1 { + String string + URI[] uris - public Test3831V1(String string, URI[] uris) { - this.string = string - this.uris = uris - } + Test3831V1(String string, URI[] uris) { + this.string = string + this.uris = uris + } - public Test3831V1(String string, List uris) { - this(string, uris.collect { new URI(it) } as URI[]) + Test3831V1(String string, List uris) { + this(string, uris.collect { new URI(it) } as URI[]) + } } -} - -class Test3831V2 { - public Test3831V2(cl) {} - public Test3831V2() { - this({1}) + static class Test3831V2 { + Test3831V2(cl) { + } + Test3831V2() { + this({1}) + } } } diff --git a/src/test/groovy/bugs/Groovy3834Bug.groovy b/src/test/groovy/bugs/Groovy3834.groovy similarity index 92% rename from src/test/groovy/bugs/Groovy3834Bug.groovy rename to src/test/groovy/bugs/Groovy3834.groovy index 4938ac64ab..ffd627a9f0 100644 --- a/src/test/groovy/bugs/Groovy3834Bug.groovy +++ b/src/test/groovy/bugs/Groovy3834.groovy @@ -23,12 +23,12 @@ import org.junit.jupiter.api.Test import static groovy.test.GroovyAssert.shouldFail import static org.junit.jupiter.api.Assertions.assertEquals +final class Groovy3834 { -class Groovy3834Bug { @Test void testDuplicateCallsToMissingMethod() { def instance = new AClassWithMethodMissingMethod() - shouldFail MissingMethodException, { instance.someMissingMethod() } + shouldFail MissingMethodException, instance.&someMissingMethod assertEquals 1, instance.count } } @@ -36,8 +36,7 @@ class Groovy3834Bug { class AClassWithMethodMissingMethod { int count = 0 def methodMissing(String name, args) { - count++ + count += 1 throw new MissingMethodException(name, AClassWithMethodMissingMethod, args) } - } diff --git a/src/test/groovy/bugs/Groovy3839.groovy b/src/test/groovy/bugs/Groovy3839.groovy index 83fe8a39e7..123fc68c91 100644 --- a/src/test/groovy/bugs/Groovy3839.groovy +++ b/src/test/groovy/bugs/Groovy3839.groovy @@ -18,13 +18,11 @@ */ package bugs -import groovy.transform.CompileStatic import org.junit.jupiter.api.Test import static groovy.test.GroovyAssert.assertScript import static groovy.test.GroovyAssert.shouldFail -@CompileStatic final class Groovy3839 { @Test diff --git a/src/test/groovy/bugs/Groovy3852.groovy b/src/test/groovy/bugs/Groovy3852.groovy index 7c78c52ca2..6426924502 100644 --- a/src/test/groovy/bugs/Groovy3852.groovy +++ b/src/test/groovy/bugs/Groovy3852.groovy @@ -18,14 +18,11 @@ */ package bugs -import groovy.transform.CompileStatic -import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import static groovy.test.GroovyAssert.assertScript import static groovy.test.GroovyAssert.shouldFail -@CompileStatic final class Groovy3852 { @Test @@ -36,7 +33,6 @@ final class Groovy3852 { @Deprecated class A {} ''' - assert err.message =~ /Cannot specify duplicate annotation/ } @@ -48,7 +44,6 @@ final class Groovy3852 { @Retention(value=RetentionPolicy.CLASS) @interface B {} ''' - assert err.message =~ /Cannot specify duplicate annotation/ } @@ -62,7 +57,6 @@ final class Groovy3852 { def m() {} } ''' - assert err.message =~ /Cannot specify duplicate annotation/ err = shouldFail ''' @@ -73,43 +67,34 @@ final class Groovy3852 { def p } ''' - assert err.message =~ /Cannot specify duplicate annotation/ } @Test void testDuplicationNonRuntimeRetentionPolicyAnnotations() { - try { - assertScript ''' - @Newify(auto=false, value=String) - @Newify(auto=false, value=String) - class Groovy3930 { - static void main(args) { - println 'success' - } + assertScript ''' + @Newify(auto=false, value=String) + @Newify(auto=false, value=String) + class Groovy3930 { + static void main(args) { + println 'success' } - ''' - } catch (any) { - Assertions.fail('Compilation should have succeeded as it has duplication annotations but with retention policy "not RUNTIME"') - } + } + ''' } @Test void testDuplicationAnnotationsForImport() { // TODO: replace with better test - Newify doesn't really make sense for import - try { - assertScript ''' - @Newify(auto=false, value=String) - @Newify(auto=false, value=String) - import java.lang.String - class Groovy3925 { - static void main(args) { - println 'success' - } + assertScript ''' + @Newify(auto=false, value=String) + @Newify(auto=false, value=String) + import java.lang.String + class Groovy3925 { + static void main(args) { + println 'success' } - ''' - } catch (any) { - Assertions.fail('Compilation should have succeeded as it has duplication annotations but with retention policy "not RUNTIME"') - } + } + ''' } } diff --git a/src/test/groovy/bugs/Groovy3857Bug.groovy b/src/test/groovy/bugs/Groovy3857.groovy similarity index 87% rename from src/test/groovy/bugs/Groovy3857Bug.groovy rename to src/test/groovy/bugs/Groovy3857.groovy index c424d878ee..1582b1d780 100644 --- a/src/test/groovy/bugs/Groovy3857Bug.groovy +++ b/src/test/groovy/bugs/Groovy3857.groovy @@ -21,14 +21,14 @@ package bugs import gls.CompilableTestSupport import org.junit.jupiter.api.Test -final class Groovy3857Bug extends CompilableTestSupport { +final class Groovy3857 extends CompilableTestSupport { @Test void testInterfaceDefWithGenericsFollowedByANewLine() { - shouldCompile """ - public interface MyMy <T extends Object> + shouldCompile ''' + interface I <T extends Object> { } - """ + ''' } } diff --git a/src/test/groovy/bugs/Groovy3863Bug.groovy b/src/test/groovy/bugs/Groovy3863.groovy similarity index 95% rename from src/test/groovy/bugs/Groovy3863Bug.groovy rename to src/test/groovy/bugs/Groovy3863.groovy index 2843d9fa3e..326dbfc5ce 100644 --- a/src/test/groovy/bugs/Groovy3863Bug.groovy +++ b/src/test/groovy/bugs/Groovy3863.groovy @@ -22,17 +22,17 @@ import org.junit.jupiter.api.Test import static groovy.test.GroovyAssert.assertScript +final class Groovy3863 { -class Groovy3863Bug { @Test void testClassNameAccessInMainMethod() { - assertScript """ + assertScript ''' class Foo3863 { static main(args) { println this.name assert this.name.contains('Foo3863') == true } } - """ + ''' } } diff --git a/src/test/groovy/bugs/Groovy3868Bug.groovy b/src/test/groovy/bugs/Groovy3868.groovy similarity index 90% rename from src/test/groovy/bugs/Groovy3868Bug.groovy rename to src/test/groovy/bugs/Groovy3868.groovy index 0118ffa706..7e5054acf4 100644 --- a/src/test/groovy/bugs/Groovy3868Bug.groovy +++ b/src/test/groovy/bugs/Groovy3868.groovy @@ -20,8 +20,8 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3868 { -class Groovy3868Bug { @Test void testAsTypeCallWithPrimitiveType() { callAndcheckResults(Long) @@ -32,11 +32,12 @@ class Groovy3868Bug { callAndcheckResults(Double) callAndcheckResults(Float) } + def callAndcheckResults(klazz) { - def num = "1" + def num = '1' def result = num.asType(klazz.TYPE) // get the primitive type of this class - if(klazz == Character) num = num as char // Character.valueOf(String) is not there + if (klazz == Character) num = num as char // Character.valueOf(String) is not there assert result == klazz.valueOf(num) assert result.class == klazz diff --git a/src/test/groovy/bugs/Groovy3871.groovy b/src/test/groovy/bugs/Groovy3871.groovy index 473b1958f8..b1adae11af 100644 --- a/src/test/groovy/bugs/Groovy3871.groovy +++ b/src/test/groovy/bugs/Groovy3871.groovy @@ -52,10 +52,10 @@ final class Groovy3871 { def otherChildInstance = new G3871Child() assert otherChildInstance.otherProp == 'porPrehto' } -} -/** a dummy base class */ -class G3871Base { } + /** a dummy base class */ + static class G3871Base { } -/** a dummy child class */ -class G3871Child extends G3871Base { } + /** a dummy child class */ + static class G3871Child extends G3871Base { } +} diff --git a/src/test/groovy/bugs/Groovy3876Bug.groovy b/src/test/groovy/bugs/Groovy3876.groovy similarity index 78% rename from src/test/groovy/bugs/Groovy3876Bug.groovy rename to src/test/groovy/bugs/Groovy3876.groovy index 9d416ec27e..2d884b7c6c 100644 --- a/src/test/groovy/bugs/Groovy3876Bug.groovy +++ b/src/test/groovy/bugs/Groovy3876.groovy @@ -21,26 +21,24 @@ package bugs import org.codehaus.groovy.runtime.typehandling.GroovyCastException import org.junit.jupiter.api.Test -import static org.junit.jupiter.api.Assertions.fail +import static groovy.test.GroovyAssert.shouldFail + +final class Groovy3876 { -class Groovy3876Bug { @Test void testGStringToNumberConversion() { def a - assert "-1" as Integer == -1 + assert '-1' as Integer == -1 a = '-1' assert "$a" as Integer == -1 - try { + shouldFail(GroovyCastException) { ((Integer) "$a") - fail('The cast should have failed with GroovyCastException') - }catch(GroovyCastException ex) { - // fine } - assert "-1000" as Integer == -1000 - a = "-1000" + assert '-1000' as Integer == -1000 + a = '-1000' assert "$a" as Integer == -1000 } } diff --git a/src/test/groovy/bugs/Groovy389_Bug.groovy b/src/test/groovy/bugs/Groovy389.groovy similarity index 78% rename from src/test/groovy/bugs/Groovy389_Bug.groovy rename to src/test/groovy/bugs/Groovy389.groovy index 0a84817128..69825747e6 100644 --- a/src/test/groovy/bugs/Groovy389_Bug.groovy +++ b/src/test/groovy/bugs/Groovy389.groovy @@ -20,25 +20,22 @@ package bugs import org.junit.jupiter.api.Test - /** - * Verifies that closures work inside case blocks. - * + * Verifies that closures work inside case blocks. */ -class Groovy389_Bug { +final class Groovy389 { @Test void testBug() { - def a = [10, 11, 12] - def b = 0 + def a = [10, 11, 12] + def b = 0 - switch( "list" ) { - case "list": - a.each { b = b + 1 } - break - } + switch ('list') { + case 'list': + a.each { b = b + 1 } + break + } - assert b == 3 + assert b == 3 } - } diff --git a/src/test/groovy/bugs/Groovy3949Bug.groovy b/src/test/groovy/bugs/Groovy3894.groovy similarity index 63% copy from src/test/groovy/bugs/Groovy3949Bug.groovy copy to src/test/groovy/bugs/Groovy3894.groovy index 62e512d30a..cb5a92ef87 100644 --- a/src/test/groovy/bugs/Groovy3949Bug.groovy +++ b/src/test/groovy/bugs/Groovy3894.groovy @@ -20,17 +20,19 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3894 { -class Groovy3949Bug { @Test - void testClosureCallInStaticContextForClassWithStaticCallMethod() { - assert Class3949.m { "$it 123" } == "1234 123" + void testInfinityToBigDecimalConversion1() { + BigDecimal x = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + assert x ** 5 == Double.POSITIVE_INFINITY + BigDecimal y = x ** 5 } -} -class Class3949 { - static call(arg) {"wrong call"} - static m(Closure closure) { - closure("1234") + @Test + void testInfinityToBigDecimalConversion2() { + BigDecimal x = -999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + assert x ** 5 == Double.NEGATIVE_INFINITY + BigDecimal y = x ** 5 } } diff --git a/src/test/groovy/bugs/Groovy3894Bug.groovy b/src/test/groovy/bugs/Groovy3894Bug.groovy deleted file mode 100644 index 2d9778a37b..0000000000 --- a/src/test/groovy/bugs/Groovy3894Bug.groovy +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package bugs - -import org.junit.jupiter.api.Test - - -class Groovy3894Bug { - @Test - void testInfinityToBigDecimalConversion() { - BigDecimal x = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 - assert x ** 5 == Double.POSITIVE_INFINITY - try { - BigDecimal y = x ** 5 - } catch (NumberFormatException nfe) { - assert nfe.message == 'Infinite or NaN' - } - - x = -999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 - assert x ** 5 == Double.NEGATIVE_INFINITY - try { - BigDecimal y = x ** 5 - } catch (NumberFormatException nfe) { - assert nfe.message == 'Infinite or NaN' - } - } -} diff --git a/src/test/groovy/bugs/Groovy3904.groovy b/src/test/groovy/bugs/Groovy3904.groovy index b04051791d..e5c06952a1 100644 --- a/src/test/groovy/bugs/Groovy3904.groovy +++ b/src/test/groovy/bugs/Groovy3904.groovy @@ -82,7 +82,8 @@ final class Groovy3904 { ''' } - @Test // GROOVY-11036 + // GROOVY-11036 + @Test void testCyclicInheritence7() { compileAndVerifyCyclicInheritenceCompilationError ''' interface I11036 {} diff --git a/src/test/groovy/bugs/Groovy3948Bug.groovy b/src/test/groovy/bugs/Groovy3948.groovy similarity index 98% rename from src/test/groovy/bugs/Groovy3948Bug.groovy rename to src/test/groovy/bugs/Groovy3948.groovy index 08bf69865b..f1e9fb632d 100644 --- a/src/test/groovy/bugs/Groovy3948Bug.groovy +++ b/src/test/groovy/bugs/Groovy3948.groovy @@ -20,8 +20,7 @@ package bugs import org.junit.jupiter.api.Test - -class Groovy3948Bug { +final class Groovy3948 { @Test void testBug1() { diff --git a/src/test/groovy/bugs/Groovy3949Bug.groovy b/src/test/groovy/bugs/Groovy3949.groovy similarity index 81% rename from src/test/groovy/bugs/Groovy3949Bug.groovy rename to src/test/groovy/bugs/Groovy3949.groovy index 62e512d30a..4794958b3d 100644 --- a/src/test/groovy/bugs/Groovy3949Bug.groovy +++ b/src/test/groovy/bugs/Groovy3949.groovy @@ -20,17 +20,17 @@ package bugs import org.junit.jupiter.api.Test +final class Groovy3949 { -class Groovy3949Bug { @Test void testClosureCallInStaticContextForClassWithStaticCallMethod() { - assert Class3949.m { "$it 123" } == "1234 123" + assert Class3949.m { "$it 123" } == '1234 123' } -} -class Class3949 { - static call(arg) {"wrong call"} - static m(Closure closure) { - closure("1234") + static class Class3949 { + static call(arg) {'wrong call'} + static m(Closure closure) { + closure('1234') + } } } diff --git a/src/test/groovy/bugs/Groovy3989Bug.groovy b/src/test/groovy/bugs/Groovy3989.groovy similarity index 92% rename from src/test/groovy/bugs/Groovy3989Bug.groovy rename to src/test/groovy/bugs/Groovy3989.groovy index 34bb35c263..5bd499ee9a 100644 --- a/src/test/groovy/bugs/Groovy3989Bug.groovy +++ b/src/test/groovy/bugs/Groovy3989.groovy @@ -21,11 +21,11 @@ package bugs import gls.CompilableTestSupport import org.junit.jupiter.api.Test -final class Groovy3989Bug extends CompilableTestSupport { +final class Groovy3989 extends CompilableTestSupport { @Test void testOverridingFinalMethods() { - shouldNotCompile """ + shouldNotCompile ''' class A { def foo() {} final def bar() {} @@ -35,6 +35,6 @@ final class Groovy3989Bug extends CompilableTestSupport { def bar() {} } B - """ + ''' } }
