|
Groovy example source code file (ReturnTest.groovy)
The Groovy ReturnTest.groovy source code
package gls.statements
import gls.CompilableTestSupport
public class ReturnTest extends CompilableTestSupport {
public void testObjectInitializer() {
shouldNotCompile """
class A {
{return}
}
"""
}
public void testStaticInitializer() {
assertScript """
class A {
static foo=2
static { return; foo=1 }
}
assert A.foo==2
"""
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy ReturnTest.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.