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 04:09:14 UTC
[groovy] 01/02: GROOVY-7033: slight tweak to test
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 0a122da1158c3db643b366625097d33674f8ccdc
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'
'''
}
}