blob: 8dd32584b4cad14e6796868d5844123be09f3bbb [file] [log] [blame]
class LocalVariableTest extends GroovyTestCase {
void testAssert() {
x = "abc"
assert x != "foo"
assert x != null
assert x != "def"
assert x == "abc"
assert x.equals("abc")
}
void testUnknownVariable() {
try {
y = x
fail("x is undefined, should throw an exception")
}
catch (MissingPropertyException e) {
assert e.getProperty() == "x"
text = e.message
//e.printStackTrace()
assert text == "No such property: x for class: LocalVariableTest"
}
}
}