use of com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression in project vespa by vespa-engine.
the class ScriptParserTestCase method requireThatStatementParserCanBeInvoked.
@Test
public void requireThatStatementParserCanBeInvoked() throws ParseException {
try {
ScriptParser.parseStatement(newContext("foo"));
} catch (ParseException e) {
assertException(e, "Encountered \" <IDENTIFIER> \"foo \"\" at line 1, column 1.");
}
assertEquals(new StatementExpression(new InputExpression("foo")), ScriptParser.parseStatement(newContext("input foo")));
assertEquals(new StatementExpression(new InputExpression("foo"), new EchoExpression()), ScriptParser.parseStatement(newContext("input foo | echo")));
assertEquals(new StatementExpression(new ScriptExpression(new StatementExpression(new InputExpression("foo")), new StatementExpression(new EchoExpression()))), ScriptParser.parseStatement(newContext("{ input foo; echo }")));
}
Aggregations