You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2021/05/10 15:41:37 UTC

[groovy] branch master updated: GROOVY-2686: add test case

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


The following commit(s) were added to refs/heads/master by this push:
     new a8023b1  GROOVY-2686: add test case
a8023b1 is described below

commit a8023b1b0d1d79800677ce2b4665ee3fb14688f4
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Mon May 10 10:41:24 2021 -0500

    GROOVY-2686: add test case
---
 src/test/groovy/lang/ClosureResolvingTest.groovy | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/test/groovy/lang/ClosureResolvingTest.groovy b/src/test/groovy/lang/ClosureResolvingTest.groovy
index 3ec93c9..e80b9cd 100644
--- a/src/test/groovy/lang/ClosureResolvingTest.groovy
+++ b/src/test/groovy/lang/ClosureResolvingTest.groovy
@@ -302,4 +302,14 @@ final class ClosureResolvingTest {
             assert link == 'http://localhost/g/bars/1/baz'
         '''
     }
+
+    @Test // GROOVY-2686
+    void testDelegateClosureProperty() {
+        assertScript '''
+            def c = { -> p() }
+            c.delegate = [p: { -> 'value' }]
+
+            assert c() == 'value'
+        '''
+    }
 }