blob: efa270a51cb4751b6197a5fd942662d5d25add1a [file] [log] [blame]
class IfTest extends GroovyTestCase {
void testUsingNumber() {
x = 1
if (x) {
println "${x} is true"
}
else {
fail("should not be false")
}
x = 0
if (x) {
fail("should not be true")
}
else {
println "${x} is false"
}
}
void testUsingString() {
x = "abc"
if (x) {
println "${x} is true"
}
else {
fail("should not be false")
}
x = 0
if (x) {
fail("should not be true")
}
else {
println "${x} is false"
}
}
}