bugfix - tabs was not a whitespace

This commit is contained in:
rusefillc 2021-01-07 04:58:58 -05:00
parent c5b1498322
commit 9a90be4472
2 changed files with 4 additions and 2 deletions

View File

@ -126,6 +126,8 @@ public class PcbNode {
if (result.length() == 0)
throw new IllegalStateException("Empty token");
log("Got token: " + result, depth);
if (Character.isWhitespace(result.charAt(0)))
throw new IllegalStateException("We do not handle whitespaces right: " + result);
return result;
}
@ -140,7 +142,7 @@ public class PcbNode {
}
private static boolean isWhitespace(char c) {
return c == ' ' || c == '\r' || c == '\n';
return Character.isWhitespace(c);
}
public static PcbNode parse(String content) {

View File

@ -26,7 +26,7 @@ public class PcbReadTest {
")";
PcbNode node = PcbNode.parse(string);
List<PcbNode> lines = node.iterate("gr_line");
assertEquals(0, lines.size());
assertEquals(1, lines.size());
}
@Test