summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-10-19 12:07:29 +0200
committerJon Bratseth <bratseth@gmail.com>2022-10-19 12:07:29 +0200
commit32a736d2b732ed72ce07dcfeff38cac9b8e96ca4 (patch)
treede497f26a7d6dd3745820fd5faa071e6560fd933
parent733cb216bc1519e34749a5e358f7e12c962c96d6 (diff)
Add a test
-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());