daniellansun commented on code in PR #2172: URL: https://github.com/apache/groovy/pull/2172#discussion_r2035885431
########## subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/GroovyshTest.groovy: ########## @@ -392,17 +394,34 @@ class GroovyshInterpreterModeTest extends GroovyshTest { } } + // groovy:000> int x = 3 + // ===> 3 + // groovy:000> x + // Unknown property: x + // groovy:000> x = 3 + // ===> 3 + // groovy:000> x + // ===> 3 + // groovy:000> void testBoundVar() { Groovysh groovysh = createGroovysh() - groovysh.execute('int x = 3') + groovysh.execute('x = 3') assert mockOut.toString().length() > 0 assert ' 3\n' == mockOut.toString().normalize()[-3..-1] groovysh.execute('x') assert mockOut.toString().length() > 0 assert ' 3\n' == mockOut.toString().normalize()[-3..-1] } + // collecting variables relies on GROOVY-4721, e.g. accessing variable declared in try block is in scope in finally block + // but after GROOVY-4721 is fixed, this test will fail, but it is aligned with the behavior of the groovySh: + // groovy:000> int x, y, z + // ===> 0 + // groovy:000> y + // Unknown property: y + // groovy:000> + @NotYetImplemented Review Comment: @paulk-asert I've polished the PR as you suggested: https://github.com/apache/groovy/pull/2172/commits/fef0b8cf6a6e7c4a472afa207808d091fdac354d -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@groovy.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org