You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/01/21 00:56:07 UTC

[groovy] branch master updated: GROOVY-7033: slight tweak to test

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d04422  GROOVY-7033: slight tweak to test
6d04422 is described below

commit 6d0442294ae34546f2755055969dac28a2e3c411
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Jan 21 10:55:40 2022 +1000

    GROOVY-7033: slight tweak to test
---
 src/test/gls/annotations/closures/AnnotationClosureTest.groovy | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/test/gls/annotations/closures/AnnotationClosureTest.groovy b/src/test/gls/annotations/closures/AnnotationClosureTest.groovy
index dee473a..3d72be2 100644
--- a/src/test/gls/annotations/closures/AnnotationClosureTest.groovy
+++ b/src/test/gls/annotations/closures/AnnotationClosureTest.groovy
@@ -156,17 +156,20 @@ final class AnnotationClosureTest extends CompilableTestSupport {
 
     // GROOVY-7033
     void testAnnotationOnAnonymousInnerClassMethod() {
-        shouldCompile '''
+        assertScript '''
             import java.lang.annotation.*
 
             @Target(ElementType.METHOD)
             @Retention(RetentionPolicy.RUNTIME)
             @interface Tag { Class<?> value() }
 
-            return new Object() {
+            def obj = new Object() {
                 @Tag(value = { -> })
                 String toString() {}
             }
+
+            Annotation ann = obj.class.getMethod('toString').annotations[0]
+            assert ann.annotationType().name == 'Tag'
         '''
     }
 }