RosettaCodeData/Task/Copy-a-string/Groovy/copy-a-string-2.groovy
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

4 lines
355 B
Groovy

assert string == stringRef // they have equal values (like Java equals(), not like Java ==)
assert string.is(stringRef) // they are references to the same objext (like Java ==)
assert string == stringCopy // they have equal values
assert ! string.is(stringCopy) // they are references to different objects (like Java !=)