forked from jasder/antlr
freshen unit tests
This commit is contained in:
parent
1f3ed5aa13
commit
f72495367c
|
@ -38,8 +38,8 @@ public class TestParserErrors extends BaseTest {
|
|||
@Test
|
||||
public void testSingleTokenDeletionConsumption() throws Exception {
|
||||
String grammar = "grammar T;\n" +
|
||||
"set: ('b'|'c') ;\n" +
|
||||
"a: 'a' set 'd' {System.out.println($set.stop);} ;";
|
||||
"myset: ('b'|'c') ;\n" +
|
||||
"a: 'a' myset 'd' {Console.WriteLine($myset.stop);} ;";
|
||||
String found = execParser("T.g4", grammar, "TParser", "TLexer", "a", "aabd", false);
|
||||
assertEquals("[@2,2:2='b',<1>,1:2]\n", found);
|
||||
assertEquals("line 1:1 extraneous input 'a' expecting {'b', 'c'}\n", this.stderrDuringParse);
|
||||
|
@ -79,8 +79,8 @@ public class TestParserErrors extends BaseTest {
|
|||
@Test
|
||||
public void testSingleSetInsertionConsumption() throws Exception {
|
||||
String grammar = "grammar T;\n" +
|
||||
"set: ('b'|'c') ;\n" +
|
||||
"a: 'a' set 'd' {System.out.println($set.stop);} ;";
|
||||
"myset: ('b'|'c') ;\n" +
|
||||
"a: 'a' myset 'd' {Console.WriteLine($myset.stop);} ;";
|
||||
String found = execParser("T.g4", grammar, "TParser", "TLexer", "a", "ad", false);
|
||||
assertEquals("[@0,0:0='a',<3>,1:0]\n", found);
|
||||
assertEquals("line 1:1 missing {'b', 'c'} at 'd'\n", this.stderrDuringParse);
|
||||
|
|
Loading…
Reference in New Issue