fixed build console
[groovy.git] / src / test / gls / scope / CompilableTestSupport.groovy
blob7a41dc0069cb990bf548f425284596e4c66aa74c
1 package gls.scope
3 import org.codehaus.groovy.control.CompilationFailedException;
4 import groovy.util.GroovyTestCase;
6 public class CompilableTestSupport extends GroovyTestCase {
7 protected void shouldNotCompile(String script) {
8 try {
9 GroovyClassLoader gcl = new GroovyClassLoader()
10 gcl.parseClass(script, getTestClassName())
11 } catch (CompilationFailedException cfe) {
12 assert true
13 return
15 fail("the compilation succeeded but should have failed")
18 protected void shouldCompile(String script) {
19 GroovyClassLoader gcl = new GroovyClassLoader()
20 gcl.parseClass(script, getTestClassName())
21 assert true