checkpoint
[sbp.git] / src / edu / berkeley / sbp / misc / RegressionTests.java
index f093e43..b972564 100644 (file)
@@ -58,14 +58,12 @@ public class RegressionTests {
     }
 
     public static class TestCase {
-        private final Token.Stream inp;
-        public final String input;
+        private final boolean tib;
+        public final String input;        
         public final String[] output;
         public final Union grammar;
         public TestCase(String input, String[] output, Union grammar, boolean tib) throws IOException {
-            this.inp = tib
-                ? new Tib(input)
-                : new CharToken.Stream(new StringReader(input), input.indexOf('\n')==-1?"\""+input+"\": ":"");
+            this.tib = tib;
             this.input = input;
             this.output = output;
             this.grammar = grammar;
@@ -80,7 +78,9 @@ public class RegressionTests {
             Forest<String> res = null;
             ParseFailed pfe = null;
             try {
-                res = new CharToStringParser(grammar).parse(inp);
+                res = tib 
+                ? new CharToStringParser(grammar).parse(new Tib(input))
+                : new CharToStringParser(grammar).parse(new StringReader(input));
             } catch (ParseFailed pf) {
                 pfe = pf;
             }