forked from jasder/antlr
freshen unit tests
This commit is contained in:
parent
e897f7ce58
commit
a3490ba322
|
@ -39,7 +39,7 @@ public class TestParserErrors extends BaseTest {
|
|||
public void testSingleTokenDeletionConsumption() throws Exception {
|
||||
String grammar = "grammar T;\n" +
|
||||
"myset: ('b'|'c') ;\n" +
|
||||
"a: 'a' myset 'd' {Console.WriteLine($myset.stop);} ;";
|
||||
"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);
|
||||
|
@ -80,7 +80,7 @@ public class TestParserErrors extends BaseTest {
|
|||
public void testSingleSetInsertionConsumption() throws Exception {
|
||||
String grammar = "grammar T;\n" +
|
||||
"myset: ('b'|'c') ;\n" +
|
||||
"a: 'a' myset 'd' {Console.WriteLine($myset.stop);} ;";
|
||||
"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