1 46 47 package groovy.bugs; 48 49 import org.codehaus.groovy.classgen.TestSupport; 50 import org.codehaus.groovy.control.CompilationFailedException; 51 52 56 public class IanMaceysBug extends TestSupport { 57 58 public void testBug() throws Exception { 59 try { 60 assertScript("dummy = 0; for ( i in 0..9 ) { dummy += i }\n println 'done'", "dummy.groovy"); 61 fail("Should throw a syntax exception"); 62 } 63 catch (CompilationFailedException e) { 64 System.out.println("Worked. Caught: " + e); 65 } 66 } 67 } 68 | Popular Tags |