Skip to content

Commit a5cbbee

Browse files
author
jdf
committed
regression test for #1511
1 parent f499073 commit a5cbbee

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

app/test/resources/bug1511.pde

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// ß
2+
3+
/**
4+
* a
5+
*/
6+
7+
import processing.pdf.*;

app/test/src/test/processing/parsing/ParserTests.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
import static org.junit.Assert.fail;
44
import java.io.File;
55
import java.io.FileInputStream;
6-
import java.io.FileNotFoundException;
7-
import java.io.IOException;
86
import java.io.InputStreamReader;
97
import java.io.StringWriter;
108
import org.junit.BeforeClass;
119
import org.junit.Test;
12-
import processing.app.Base;
1310
import processing.app.Preferences;
1411
import processing.app.debug.RunnerException;
1512
import processing.app.preproc.PdePreprocessor;
@@ -18,12 +15,11 @@
1815
public 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

Comments
 (0)