blob: e3b8c088758d0ff03afc5ba94a2bd14e9e46301d [file] [log] [blame]
class CompilerErrorTest extends GroovyTestCase {
void testBadMethodName() {
shouldFail {
shell = new GroovyShell()
text = 'println ${name}'
println "About to test script ${text}"
shell.evaluate text
}
}
void testBadPropertyName() {
shouldFail {
shell = new GroovyShell()
shell.evaluate """
x = [:]
x.$foo = 123
"""
}
}
void testBadVariableName() {
shouldFail {
shell = new GroovyShell()
shell.evaluate """
$x = 123
"""
}
}
}