blob: 0cc179af3c7ad51fd457b0da38eeaf06c8ed4720 [file] [log] [blame]
/**
* @version $Revision$
*/
class Bytecode4Bug extends GroovyTestCase {
count = 0
void testInject() {
x = [1, 2, 3].inject(0) { c, s | c += s }
assert x == 6
}
void testUsingProperty() {
count = 0
getCollection().each { count += it }
assert count == 10
}
void testUsingIncrementingProperty() {
count = 0
getCollection().each { count++ }
assert count == 4
}
getCollection() {
[1, 2, 3, 4]
}
}