blob: 11afeb2310ed20ed4c4db11817b835bb108468ee [file] [log] [blame]
import org.codehaus.groovy.classgen.TestSupport
/**
* @author John Wilson
* @version $Revision$
*/
class ClosureParameterPassingBug extends TestSupport {
void testBugInMethod() {
c = { x |
y = 123
c1 = {
println y
println x
println x[0]
}
c1()
}
c([1])
}
void testBug() {
assertScript <<<EOF
c = { x |
y = 123
c1 = {
assert x != null : "Could not find a value for x"
assert y == 123 : "Could not find a value for y"
println x[0]
}
c1()
}
c([1])
EOF
}
}