allow tabs to separate signal names in test case header

This commit is contained in:
hneemann 2017-07-16 23:02:25 +02:00
parent 8f0a481023
commit 9755e42d75
2 changed files with 13 additions and 0 deletions

View File

@ -288,6 +288,7 @@ public class Tokenizer {
return Token.IDENT;
} else
return Token.EOL;
case '\t':
case ' ':
if (builder.length() > 0) {
return Token.IDENT;

View File

@ -137,6 +137,18 @@ public class ParserTest extends TestCase {
assertEquals(1, td.getLines().size());
}
public void testHeaderTabs() throws TestingDataException, IOException, ParserException {
Parser parser = new Parser("A\tB\tC \t D\n1\t1\t1\t1").parse();
LineCollector td = new LineCollector(parser);
assertEquals(4, td.getNames().size());
assertEquals("A", td.getNames().get(0));
assertEquals("B", td.getNames().get(1));
assertEquals("C", td.getNames().get(2));
assertEquals("D", td.getNames().get(3));
assertEquals(1, td.getLines().size());
assertEquals(4, td.getLines().get(0).length);
}
public void testEmptyLines() throws TestingDataException, IOException, ParserException {
Parser parser = new Parser("A_i B_i C_i-1 C_i S_i\n" +
" 0 0 0 0 0\n" +