Remove unnecessary testing constructor
This commit is contained in:
parent
45fd53bf2c
commit
72675075cf
|
@ -122,8 +122,6 @@ public class ParseTreePatternMatcher {
|
|||
protected String start = "<", stop=">";
|
||||
protected String escape = "\\"; // e.g., \< and \> must escape BOTH!
|
||||
|
||||
public ParseTreePatternMatcher() { } // used for testing only
|
||||
|
||||
/** Constructs a pattern match or from a lecture and parser object.
|
||||
* The lexer input stream is altered for tokenizing the tree patterns.
|
||||
* The parser is used as a convenient mechanism to get the grammar name,
|
||||
|
|
|
@ -23,7 +23,7 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class TestParseTreeMatcher extends BaseTest {
|
||||
@Test public void testChunking() throws Exception {
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher();
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher(null, null);
|
||||
assertEquals("[ID, ' = ', expr, ' ;']", m.split("<ID> = <expr> ;").toString());
|
||||
assertEquals("[' ', ID, ' = ', expr]", m.split(" <ID> = <expr>").toString());
|
||||
assertEquals("[ID, ' = ', expr]", m.split("<ID> = <expr>").toString());
|
||||
|
@ -33,14 +33,14 @@ public class TestParseTreeMatcher extends BaseTest {
|
|||
}
|
||||
|
||||
@Test public void testDelimiters() throws Exception {
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher();
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher(null, null);
|
||||
m.setDelimiters("<<", ">>", "$");
|
||||
String result = m.split("<<ID>> = <<expr>> ;$<< ick $>>").toString();
|
||||
assertEquals("[ID, ' = ', expr, ' ;<< ick >>']", result);
|
||||
}
|
||||
|
||||
@Test public void testInvertedTags() throws Exception {
|
||||
ParseTreePatternMatcher m= new ParseTreePatternMatcher();
|
||||
ParseTreePatternMatcher m= new ParseTreePatternMatcher(null, null);
|
||||
String result = null;
|
||||
try {
|
||||
m.split(">expr<");
|
||||
|
@ -53,7 +53,7 @@ public class TestParseTreeMatcher extends BaseTest {
|
|||
}
|
||||
|
||||
@Test public void testUnclosedTag() throws Exception {
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher();
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher(null, null);
|
||||
String result = null;
|
||||
try {
|
||||
m.split("<expr hi mom");
|
||||
|
@ -66,7 +66,7 @@ public class TestParseTreeMatcher extends BaseTest {
|
|||
}
|
||||
|
||||
@Test public void testExtraClose() throws Exception {
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher();
|
||||
ParseTreePatternMatcher m = new ParseTreePatternMatcher(null, null);
|
||||
String result = null;
|
||||
try {
|
||||
m.split("<expr> >");
|
||||
|
|
Loading…
Reference in New Issue