use of org.apache.cayenne.exp.parser.ASTLike in project cayenne by apache.
the class LikeExpressionHelperTest method testEscape_TwoChars.
@Test
public void testEscape_TwoChars() {
PatternMatchNode node = new ASTLike(new ASTObjPath("x"), "ab_c_");
LikeExpressionHelper.escape(node);
assertEquals("ab!_c!_", node.getOperand(1));
assertEquals('!', node.getEscapeChar());
}
use of org.apache.cayenne.exp.parser.ASTLike in project cayenne by apache.
the class LikeExpressionHelperTest method testEscape_AltEscapeChar1.
@Test
public void testEscape_AltEscapeChar1() {
PatternMatchNode node = new ASTLike(new ASTObjPath("x"), "a!%c");
LikeExpressionHelper.escape(node);
assertEquals("a!#%c", node.getOperand(1));
assertEquals('#', node.getEscapeChar());
}
Aggregations