diff options
author | gjoranv <gv@oath.com> | 2018-12-06 13:13:57 +0100 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2018-12-06 14:19:01 +0100 |
commit | 9820f82abab66b045f6ce65c03477903180f61b4 (patch) | |
tree | efb0ce12a49e8eca52058196193b36ddf6d7373c /indexinglanguage/src | |
parent | 49de3f5478c4a44c8f5cebcb15062eb6289ddd35 (diff) |
Update to latest ph-javacc-maven-plugin.
- Update FastCharStream method names to follow changes in
generated CharStream class.
- Update expected test output due to improvements in generated
code.
- Improve ability to debug tests by more clearly printing out
the diff between expected and actual output.
Diffstat (limited to 'indexinglanguage/src')
-rw-r--r-- | indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptParserTestCase.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptParserTestCase.java b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptParserTestCase.java index cd6008d67d1..0df3073cd25 100644 --- a/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptParserTestCase.java +++ b/indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ScriptParserTestCase.java @@ -11,6 +11,7 @@ import com.yahoo.vespa.indexinglanguage.parser.ParseException; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * @author Simon Thoresen Hult @@ -22,7 +23,7 @@ public class ScriptParserTestCase { try { ScriptParser.parseExpression(newContext("foo")); } catch (ParseException e) { - assertException(e, "Encountered \" <IDENTIFIER> \"foo \"\" at line 1, column 1."); + assertException(e, "Encountered \" <IDENTIFIER> \"foo\"\" at line 1, column 1."); } assertEquals(new InputExpression("foo"), ScriptParser.parseExpression(newContext("input foo"))); @@ -38,7 +39,7 @@ public class ScriptParserTestCase { try { ScriptParser.parseStatement(newContext("foo")); } catch (ParseException e) { - assertException(e, "Encountered \" <IDENTIFIER> \"foo \"\" at line 1, column 1."); + assertException(e, "Encountered \" <IDENTIFIER> \"foo\"\" at line 1, column 1."); } assertEquals(new StatementExpression(new InputExpression("foo")), ScriptParser.parseStatement(newContext("input foo"))); @@ -54,17 +55,17 @@ public class ScriptParserTestCase { try { ScriptParser.parseScript(newContext("foo")); } catch (ParseException e) { - assertException(e, "Encountered \" <IDENTIFIER> \"foo \"\" at line 1, column 1."); + assertException(e, "Encountered \" <IDENTIFIER> \"foo\"\" at line 1, column 1."); } try { ScriptParser.parseScript(newContext("input foo")); } catch (ParseException e) { - assertException(e, "Encountered \" \"input\" \"input \"\" at line 1, column 1."); + assertException(e, "Encountered \" \"input\" \"input\"\" at line 1, column 1."); } try { ScriptParser.parseScript(newContext("input foo | echo")); } catch (ParseException e) { - assertException(e, "Encountered \" \"input\" \"input \"\" at line 1, column 1."); + assertException(e, "Encountered \" \"input\" \"input\"\" at line 1, column 1."); } assertEquals(new ScriptExpression(new StatementExpression(new InputExpression("foo")), new StatementExpression(new EchoExpression())), @@ -89,7 +90,7 @@ public class ScriptParserTestCase { private static void assertException(ParseException e, String expectedMessage) throws ParseException { if (!e.getMessage().startsWith(expectedMessage)) { - throw e; + fail("Expected exception with message starting with:\n'" + expectedMessage + ", but got:\n'" + e.getMessage()); } } |