use of io.airlift.joni.Regex in project presto by prestodb.
the class TestLikeFunctions method testLikeUtf8Pattern.
@Test(timeOut = 1000)
public void testLikeUtf8Pattern() {
Regex regex = likePattern(utf8Slice("%名誉%"), utf8Slice("\\"));
assertFalse(like(utf8Slice("foo"), regex));
}
use of io.airlift.joni.Regex in project presto by prestodb.
the class TestLikeFunctions method testLikeNewlineInPattern.
@Test
public void testLikeNewlineInPattern() {
Regex regex = likePattern(utf8Slice("%o\nbar"));
assertTrue(like(utf8Slice("foo\nbar"), regex));
}
use of io.airlift.joni.Regex in project presto by prestodb.
the class TestLikeFunctions method testBackslashesNoSpecialTreatment.
@Test
public void testBackslashesNoSpecialTreatment() throws Exception {
Regex regex = likePattern(utf8Slice("\\abc\\/\\\\"));
assertTrue(like(utf8Slice("\\abc\\/\\\\"), regex));
}
use of io.airlift.joni.Regex in project presto by prestodb.
the class TestLikeFunctions method testLikeBasic.
@Test
public void testLikeBasic() {
Regex regex = likePattern(utf8Slice("f%b__"));
assertTrue(like(utf8Slice("foobar"), regex));
}
use of io.airlift.joni.Regex in project presto by prestodb.
the class TestLikeFunctions method testAlternateEscapedCharacters.
@Test
public void testAlternateEscapedCharacters() throws Exception {
Regex regex = likePattern(utf8Slice("xxx%x_abcxx"), utf8Slice("x"));
assertTrue(like(utf8Slice("x%_abcx"), regex));
}
Aggregations