33import static org .junit .Assert .fail ;
44import java .io .File ;
55import java .io .FileInputStream ;
6- import java .io .FileNotFoundException ;
7- import java .io .IOException ;
86import java .io .InputStreamReader ;
97import java .io .StringWriter ;
108import org .junit .BeforeClass ;
119import org .junit .Test ;
12- import processing .app .Base ;
1310import processing .app .Preferences ;
1411import processing .app .debug .RunnerException ;
1512import processing .app .preproc .PdePreprocessor ;
1815public class ParserTests {
1916
2017 private static final String RESOURCES = "test/resources/" ;
21-
22- private static File res (final String resourceName )
23- {
24- return new File (RESOURCES ,resourceName );
18+
19+ private static File res (final String resourceName ) {
20+ return new File (RESOURCES , resourceName );
2521 }
26-
22+
2723 @ BeforeClass
2824 static public void initPrefs () throws Exception {
2925 Preferences .load (new FileInputStream (res ("preferences.txt" )));
@@ -60,7 +56,10 @@ static void expectGood(final String resource) {
6056 try {
6157 preprocess (resource );
6258 } catch (Exception e ) {
63- fail (e .getMessage ());
59+ if (!e .equals (e .getCause ()))
60+ fail (e .getCause ().getMessage ());
61+ else
62+ fail (e .getMessage ());
6463 }
6564 }
6665
@@ -73,4 +72,9 @@ public void bug5a() {
7372 public void bug5b () {
7473 expectGood ("bug5.b.pde" );
7574 }
75+
76+ @ Test
77+ public void bug1511 () {
78+ expectGood ("bug1511.pde" );
79+ }
7680}
0 commit comments