|
Groovy example source code file (Groovy3304Bug.groovy)
The Groovy Groovy3304Bug.groovy source code
package groovy.bugs
import org.codehaus.groovy.control.MultipleCompilationErrorsException
class Groovy3304Bug extends GroovyTestCase {
void testBreakAfterSwitchCausesSyntaxError() {
try {
new GroovyShell().parse("switch(x) {}\nbreak")
fail()
} catch (MultipleCompilationErrorsException e) {
def syntaxError = e.errorCollector.getSyntaxError(0)
assert syntaxError
assert syntaxError.line == 2
}
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy Groovy3304Bug.groovy source code file: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.