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 2021/04/01 04:30:41 UTC

[groovy] 04/10: GROOVY-9993: Field and a property with the same name: clarification of boundary cases (tweak existing 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

commit cd8730b5fdda2267264ede35aed5aa7c482ff6d0
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Mar 30 21:01:28 2021 +1000

    GROOVY-9993: Field and a property with the same name: clarification of boundary cases (tweak existing test)
---
 src/spec/test/ClassTest.groovy | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/spec/test/ClassTest.groovy b/src/spec/test/ClassTest.groovy
index b6a4bd9..80e9e32 100644
--- a/src/spec/test/ClassTest.groovy
+++ b/src/spec/test/ClassTest.groovy
@@ -333,17 +333,17 @@ class ClassTest extends GroovyTestCase {
             class Person {
                 String name
                 void name(String name) {
-                    this.name = "Wonder$name"       // <1>
+                    this.name = "Wonder $name"      // <1>
                 }
-                String wonder() {
+                String title() {
                     this.name                       // <2>
                 }
             }
             def p = new Person()
-            p.name = 'Marge'                        // <3>
-            assert p.name == 'Marge'                // <4>
-            p.name('Marge')                         // <5>
-            assert p.wonder() == 'WonderMarge'      // <6>
+            p.name = 'Diana'                        // <3>
+            assert p.name == 'Diana'                // <4>
+            p.name('Woman')                         // <5>
+            assert p.title() == 'Wonder Woman'      // <6>
             // end::property_access[]
         '''