regression test for #1511

This commit is contained in:
jdf
2010-03-17 17:35:23 +00:00
parent a97a880114
commit fa46792605
2 changed files with 20 additions and 9 deletions

View File

@@ -0,0 +1,7 @@
// ß
/**
* a
*/
import processing.pdf.*;

View File

@@ -3,13 +3,10 @@ package test.processing.parsing;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringWriter;
import org.junit.BeforeClass;
import org.junit.Test;
import processing.app.Base;
import processing.app.Preferences;
import processing.app.debug.RunnerException;
import processing.app.preproc.PdePreprocessor;
@@ -18,12 +15,11 @@ import antlr.ANTLRException;
public class ParserTests {
private static final String RESOURCES = "test/resources/";
private static File res(final String resourceName)
{
return new File(RESOURCES,resourceName);
private static File res(final String resourceName) {
return new File(RESOURCES, resourceName);
}
@BeforeClass
static public void initPrefs() throws Exception {
Preferences.load(new FileInputStream(res("preferences.txt")));
@@ -60,7 +56,10 @@ public class ParserTests {
try {
preprocess(resource);
} catch (Exception e) {
fail(e.getMessage());
if (!e.equals(e.getCause()))
fail(e.getCause().getMessage());
else
fail(e.getMessage());
}
}
@@ -73,4 +72,9 @@ public class ParserTests {
public void bug5b() {
expectGood("bug5.b.pde");
}
@Test
public void bug1511() {
expectGood("bug1511.pde");
}
}