A few changes in test files after running the test generator (mostly reordered tests).

This commit is contained in:
Mike Lischke 2016-05-04 10:14:24 +02:00
parent aa88e7bc30
commit 5489ad2ac6
10 changed files with 94 additions and 95 deletions

View File

@ -58,18 +58,18 @@ public class TestCompositeParsers extends BaseTest {
@Test
public void testDelegatesSeeSameTokenType() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {Console.WriteLine(\"S.x\");};";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { C, B, A } // reverse order\n" +
"y : A {Console.WriteLine(\"T.y\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {Console.WriteLine(\"S.x\");};";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(598);
grammarBuilder.append("// The lexer will create rules to match letters a, b, c.\n");
grammarBuilder.append("// The associated token types A, B, C must have the same value\n");
@ -191,17 +191,17 @@ public class TestCompositeParsers extends BaseTest {
@Test
public void testDelegatorInvokesFirstVersionOfDelegateRule() throws Exception {
mkdir(tmpdir);
String slave_T =
"parser grammar T;\n" +
"a : B {Console.WriteLine(\"T.a\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {Console.WriteLine(\"S.a\");};\n" +
"b : B;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"a : B {Console.WriteLine(\"T.a\");};";
writeFile(tmpdir, "T.g4", slave_T);
StringBuilder grammarBuilder = new StringBuilder(106);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S,T;\n");
@ -241,18 +241,18 @@ public class TestCompositeParsers extends BaseTest {
@Test
public void testDelegatorRuleOverridesDelegates() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"a : b {Console.WriteLine(\"S.a\");};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { A }\n" +
"b : 'b' {Console.WriteLine(\"T.b\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {Console.WriteLine(\"S.a\");};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(94);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S, T;\n");

View File

@ -2,6 +2,7 @@
package org.antlr.v4.test.runtime.csharp;
import org.junit.Test;
import org.junit.Ignore;
@SuppressWarnings("unused")
public class TestParseTrees extends BaseTest {

View File

@ -72,18 +72,18 @@ public class TestCompositeParsers extends BaseTest {
public void testDelegatesSeeSameTokenType() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {System.out.println(\"S.x\");};";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { C, B, A } // reverse order\n" +
"y : A {System.out.println(\"T.y\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {System.out.println(\"S.x\");};";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(598);
grammarBuilder.append("// The lexer will create rules to match letters a, b, c.\n");
grammarBuilder.append("// The associated token types A, B, C must have the same value\n");
@ -236,17 +236,17 @@ public class TestCompositeParsers extends BaseTest {
public void testDelegatorInvokesFirstVersionOfDelegateRule() throws Exception {
mkdir(tmpdir);
String slave_T =
"parser grammar T;\n" +
"a : B {System.out.println(\"T.a\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {System.out.println(\"S.a\");};\n" +
"b : B;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"a : B {System.out.println(\"T.a\");};";
writeFile(tmpdir, "T.g4", slave_T);
StringBuilder grammarBuilder = new StringBuilder(106);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S,T;\n");
@ -294,18 +294,18 @@ public class TestCompositeParsers extends BaseTest {
public void testDelegatorRuleOverridesDelegates() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"a : b {System.out.println(\"S.a\");};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { A }\n" +
"b : 'b' {System.out.println(\"T.b\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {System.out.println(\"S.a\");};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(95);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S, T;\n");

View File

@ -1,10 +1,10 @@
/* This file is generated by TestGenerator, any edits will be overwritten by the next generation. */
package org.antlr.v4.test.runtime.java;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.*;
public class TestParseTrees extends BaseTest {

View File

@ -64,18 +64,18 @@ public class TestCompositeParsers extends BaseTest {
@Test
public void testDelegatesSeeSameTokenType() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {console.log(\"S.x\");};";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { C, B, A } // reverse order\n" +
"y : A {console.log(\"T.y\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {console.log(\"S.x\");};";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(598);
grammarBuilder.append("// The lexer will create rules to match letters a, b, c.\n");
grammarBuilder.append("// The associated token types A, B, C must have the same value\n");
@ -207,17 +207,17 @@ public class TestCompositeParsers extends BaseTest {
@Test
public void testDelegatorInvokesFirstVersionOfDelegateRule() throws Exception {
mkdir(tmpdir);
String slave_T =
"parser grammar T;\n" +
"a : B {console.log(\"T.a\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {console.log(\"S.a\");};\n" +
"b : B;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"a : B {console.log(\"T.a\");};";
writeFile(tmpdir, "T.g4", slave_T);
StringBuilder grammarBuilder = new StringBuilder(106);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S,T;\n");
@ -261,18 +261,18 @@ public class TestCompositeParsers extends BaseTest {
@Test
public void testDelegatorRuleOverridesDelegates() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"a : b {console.log(\"S.a\");};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { A }\n" +
"b : 'b' {console.log(\"T.b\");};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {console.log(\"S.a\");};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(88);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S, T;\n");

View File

@ -1,10 +1,10 @@
/* This file is generated by TestGenerator, any edits will be overwritten by the next generation. */
package org.antlr.v4.test.runtime.javascript.node;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.*;
@SuppressWarnings("unused")
public class TestParseTrees extends BaseTest {

View File

@ -75,18 +75,18 @@ public class TestCompositeParsers extends BasePython2Test {
public void testDelegatesSeeSameTokenType() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {print(\"S.x\")};";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { C, B, A } // reverse order\n" +
"y : A {print(\"T.y\")};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {print(\"S.x\")};";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(598);
grammarBuilder.append("// The lexer will create rules to match letters a, b, c.\n");
grammarBuilder.append("// The associated token types A, B, C must have the same value\n");
@ -245,17 +245,17 @@ public class TestCompositeParsers extends BasePython2Test {
public void testDelegatorInvokesFirstVersionOfDelegateRule() throws Exception {
mkdir(tmpdir);
String slave_T =
"parser grammar T;\n" +
"a : B {print(\"T.a\")};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {print(\"S.a\")};\n" +
"b : B;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"a : B {print(\"T.a\")};";
writeFile(tmpdir, "T.g4", slave_T);
StringBuilder grammarBuilder = new StringBuilder(106);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S,T;\n");
@ -305,18 +305,18 @@ public class TestCompositeParsers extends BasePython2Test {
public void testDelegatorRuleOverridesDelegates() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"a : b {print(\"S.a\")};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { A }\n" +
"b : 'b' {print(\"T.b\")};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {print(\"S.a\")};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(81);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S, T;\n");

View File

@ -1,10 +1,9 @@
/* This file is generated by TestGenerator, any edits will be overwritten by the next generation. */
package org.antlr.v4.test.runtime.python2;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.*;
@SuppressWarnings("unused")
public class TestParseTrees extends BasePython2Test {

View File

@ -75,18 +75,18 @@ public class TestCompositeParsers extends BasePython3Test {
public void testDelegatesSeeSameTokenType() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {print(\"S.x\")};";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { C, B, A } // reverse order\n" +
"y : A {print(\"T.y\")};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"tokens { A, B, C }\n" +
"x : A {print(\"S.x\")};";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(598);
grammarBuilder.append("// The lexer will create rules to match letters a, b, c.\n");
grammarBuilder.append("// The associated token types A, B, C must have the same value\n");
@ -245,17 +245,17 @@ public class TestCompositeParsers extends BasePython3Test {
public void testDelegatorInvokesFirstVersionOfDelegateRule() throws Exception {
mkdir(tmpdir);
String slave_T =
"parser grammar T;\n" +
"a : B {print(\"T.a\")};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {print(\"S.a\")};\n" +
"b : B;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"a : B {print(\"T.a\")};";
writeFile(tmpdir, "T.g4", slave_T);
StringBuilder grammarBuilder = new StringBuilder(106);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S,T;\n");
@ -305,18 +305,18 @@ public class TestCompositeParsers extends BasePython3Test {
public void testDelegatorRuleOverridesDelegates() throws Exception {
mkdir(tmpdir);
String slave_S =
"parser grammar S;\n" +
"a : b {print(\"S.a\")};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
String slave_T =
"parser grammar T;\n" +
"tokens { A }\n" +
"b : 'b' {print(\"T.b\")};";
writeFile(tmpdir, "T.g4", slave_T);
String slave_S =
"parser grammar S;\n" +
"a : b {print(\"S.a\")};\n" +
"b : 'b' ;";
writeFile(tmpdir, "S.g4", slave_S);
StringBuilder grammarBuilder = new StringBuilder(81);
grammarBuilder.append("grammar M;\n");
grammarBuilder.append("import S, T;\n");

View File

@ -1,10 +1,9 @@
/* This file is generated by TestGenerator, any edits will be overwritten by the next generation. */
package org.antlr.v4.test.runtime.python3;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.*;
@SuppressWarnings("unused")
public class TestParseTrees extends BasePython3Test {