summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Aune <kkraune@users.noreply.github.com>2022-10-19 12:39:10 +0200
committerGitHub <noreply@github.com>2022-10-19 12:39:10 +0200
commit4c2b3a8ce6116c50cb20c560be08e37490efb1ad (patch)
tree20427440e340c45f69a62d8c43f34d5e089954af
parent9bd0a86bba6280aded2ff575ba095a446d6aa4e7 (diff)
parent32a736d2b732ed72ce07dcfeff38cac9b8e96ca4 (diff)
Merge pull request #24503 from vespa-engine/bratseth/backslash-test
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());