(JSONParser p, String input, String expected)
| 112 | |
| 113 | // match parser states with the expected states |
| 114 | public static void parse(JSONParser p, String input, String expected) throws IOException { |
| 115 | expected += "e"; |
| 116 | for (int i = 0; i < expected.length(); i++) { |
| 117 | int ev = p.nextEvent(); |
| 118 | int expect = events[expected.charAt(i)]; |
| 119 | if (ev != expect) { |
| 120 | fail( |
| 121 | "Expected " |
| 122 | + expect |
| 123 | + ", got " |
| 124 | + ev |
| 125 | + "\n\tINPUT=" |
| 126 | + input |
| 127 | + "\n\tEXPECTED=" |
| 128 | + expected |
| 129 | + "\n\tAT=" |
| 130 | + i |
| 131 | + " (" |
| 132 | + expected.charAt(i) |
| 133 | + ")"); |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | public static void parse(String input, String expected) throws IOException { |
| 139 | String in = input; |
no test coverage detected