use of io.crate.sql.tree.EscapedCharStringLiteral in project crate by crate.
the class TestStatementBuilder method testEscapedStringLiteral.
@Test
public void testEscapedStringLiteral() {
String input = "this is a triple-a:\\141\\x61\\u0061";
String expectedValue = "this is a triple-a:aaa";
Expression expr = SqlParser.createExpression(Literals.quoteEscapedStringLiteral(input));
EscapedCharStringLiteral escapedCharStringLiteral = (EscapedCharStringLiteral) expr;
assertThat(escapedCharStringLiteral.getRawValue(), is(input));
assertThat(escapedCharStringLiteral.getValue(), is(expectedValue));
}
Aggregations