blob: fcfde1f5d5927d6b9994bcf7634b7d2bec6313ad [file] [log] [blame]
class ClosureReturnWithoutReturnStatementTest extends GroovyTestCase {
void testReturnValues() {
block = {x| x > 5}
value = block.call(10)
assert value
value = block.call(3)
assert value == false
}
void testReturnValueUsingFunction() {
block = {x| someFunction(x) }
value = block.call(10)
assert value
value = block.call(3)
assert value == false
}
someFunction(x) {
x > 5
}
}