Skip to content

Commit

Permalink
Merge pull request #21 from bdkearns/fix-tests
Browse files Browse the repository at this point in the history
update tests for deterministic naming in 08ed190
  • Loading branch information
ericvergnaud committed Oct 28, 2014
2 parents 66fa76d + a355ecf commit ec1844f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tool/test/org/antlr/v4/py2/test/TestFullContextParsing.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ public void testSLLSeesEOFInLLGrammar() {
input, true);
expecting =
"Decision 1:\n" +
"s0-'else'->:s1^=>1\n" +
"s0-'}'->:s2=>2\n";
"s0-'}'->:s2=>2\n" +
"s0-'else'->:s1^=>1\n";
assertEquals(expecting, result);
assertEquals("line 1:29 reportAttemptingFullContext d=1 (stat), input='else'\n" +
"line 1:38 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}'\n",
Expand Down Expand Up @@ -226,8 +226,8 @@ public void testSLLSeesEOFInLLGrammar() {
input, true);
expecting =
"Decision 1:\n" +
"s0-'else'->:s1^=>1\n" +
"s0-'}'->:s2=>2\n";
"s0-'}'->:s2=>2\n" +
"s0-'else'->:s1^=>1\n";
assertEquals(expecting, result);
assertEquals("line 1:19 reportAttemptingFullContext d=1 (stat), input='else'\n" +
"line 1:19 reportContextSensitivity d=1 (stat), input='else'\n" +
Expand All @@ -242,8 +242,8 @@ public void testSLLSeesEOFInLLGrammar() {
input, true);
expecting =
"Decision 1:\n" +
"s0-'else'->:s1^=>1\n" +
"s0-'}'->:s2=>2\n";
"s0-'}'->:s2=>2\n" +
"s0-'else'->:s1^=>1\n";
assertEquals(expecting, result);
assertEquals("line 1:19 reportAttemptingFullContext d=1 (stat), input='else'\n" +
"line 1:19 reportContextSensitivity d=1 (stat), input='else'\n" +
Expand Down
2 changes: 1 addition & 1 deletion tool/test/org/antlr/v4/py2/test/TestLexerErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void testLexerExecDFA() throws Exception {
String result = execLexer("T.g4", grammar, "TLexer", "x : x", false);
String expecting =
"[@0,0:0='x',<3>,1:0]\n" +
"[@1,2:2=':',<2>,1:2]\n" +
"[@1,2:2=':',<1>,1:2]\n" +
"[@2,4:4='x',<3>,1:4]\n" +
"[@3,5:4='<EOF>',<-1>,1:5]\n";
assertEquals(expecting, result);
Expand Down
4 changes: 2 additions & 2 deletions tool/test/org/antlr/v4/py2/test/TestParseErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class TestParseErrors extends BasePython2Test {
"grammar T;\n" +
"a : 'a' x='b' {print(\"conjured=\"+str($x))} 'c' ;";
String result = execParser("T.g4", grammar, "TParser", "TLexer", "TListener", "TVisitor", "a", "ac", false);
String expecting = "conjured=[@-1,-1:-1='<missing 'b'>',<1>,1:1]\n";
String expecting = "conjured=[@-1,-1:-1='<missing 'b'>',<2>,1:1]\n";
assertEquals(expecting, result);
}

Expand All @@ -104,7 +104,7 @@ public class TestParseErrors extends BasePython2Test {
"grammar T;\n" +
"a : 'a' x=('b'|'c') {print(\"conjured=\"+str($x))} 'd' ;";
String result = execParser("T.g4", grammar, "TParser", "TLexer", "TListener", "TVisitor", "a", "ad", false);
String expecting = "conjured=[@-1,-1:-1='<missing 'b'>',<1>,1:1]\n";
String expecting = "conjured=[@-1,-1:-1='<missing 'b'>',<2>,1:1]\n";
assertEquals(expecting, result);
}

Expand Down

0 comments on commit ec1844f

Please sign in to comment.