assertThat( converter.getRegExpFromLikeExpression( "%foo[]%bar" ).pattern() ).isEqualTo( "^.*\\Qfoo[]\\E.*\\Qbar\\E$" );
}
@Test
public void shouldCreateExpressionsWithEscapeCharacter() {
LikeExpressionToRegExpConverter converter = new LikeExpressionToRegExpConverter( '$' );
assertThat( converter.getRegExpFromLikeExpression( "10$%" ).pattern() ).isEqualTo( "^\\Q10%\\E$" );
assertThat( converter.getRegExpFromLikeExpression( "10$%, 20$%" ).pattern() ).isEqualTo( "^\\Q10%, 20%\\E$" );
assertThat( converter.getRegExpFromLikeExpression( "10$%%20$%" ).pattern() ).isEqualTo( "^\\Q10%\\E.*\\Q20%\\E$" );
assertThat( converter.getRegExpFromLikeExpression( "10$% (in $$)" ).pattern() ).isEqualTo( "^\\Q10% (in $)\\E$" );
}