summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java
index 807681e1d7b..fd0168393ec 100644
--- a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java
@@ -43,6 +43,8 @@ import com.yahoo.search.query.Sorting.Order;
import com.yahoo.search.query.Sorting.UcaSorter;
import com.yahoo.search.query.parser.Parsable;
import com.yahoo.search.query.parser.ParserEnvironment;
+import com.yahoo.search.query.parser.ParserFactory;
+
import com.yahoo.search.searchchain.Execution;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
@@ -72,6 +74,12 @@ public class YqlParserTestCase {
}
@Test
+ void backslashCanBeEscaped() {
+ // Java escaping on top of YQL escaping, to produce a regexp with a single backslash
+ assertParse("select * from sources * where artist matches 'a\\\\.'", "RegExpItem [expression=a\\.]");
+ }
+
+ @Test
void testParserDefaults() {
assertTrue(parser.isQueryParser());
assertNull(parser.getDocTypes());