From 32a736d2b732ed72ce07dcfeff38cac9b8e96ca4 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Wed, 19 Oct 2022 12:07:29 +0200 Subject: Add a test --- .../src/test/java/com/yahoo/search/yql/YqlParserTestCase.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'container-search/src/test') 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; @@ -71,6 +73,12 @@ public class YqlParserTestCase { new IllegalInputException("com.yahoo.search.yql.ProgramCompileException: query:L1:79 token recognition error at: 'œ'")); } + @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()); -- cgit v1.2.3