summaryrefslogtreecommitdiffstats
path: root/container-search/src/test
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-12-03 10:22:26 +0100
committerJon Bratseth <bratseth@gmail.com>2020-12-03 10:22:26 +0100
commitf0ef833df79cd84148d21679f3b5660bbe15cc60 (patch)
tree6a11a3317eec125128e34ee09688569ec44625c8 /container-search/src/test
parent868a770f58ff5616489886091d944a04e698dda5 (diff)
Handle tensor types with cell type parameter
Diffstat (limited to 'container-search/src/test')
-rw-r--r--container-search/src/test/java/com/yahoo/search/searchers/test/QueryValidatorTestCase.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/searchers/test/QueryValidatorTestCase.java b/container-search/src/test/java/com/yahoo/search/searchers/test/QueryValidatorTestCase.java
index 8789de7198c..e93921af982 100644
--- a/container-search/src/test/java/com/yahoo/search/searchers/test/QueryValidatorTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/searchers/test/QueryValidatorTestCase.java
@@ -20,7 +20,8 @@ public class QueryValidatorTestCase {
@Test
public void testValidation() {
SearchDefinition sd = new SearchDefinition("test");
- sd.addCommand("mytensor", "type tensor(x[100]");
+ sd.addCommand("mytensor1", "type tensor(x[100]");
+ sd.addCommand("mytensor2", "type tensor<float>(x[100]");
sd.addCommand("mystring", "type string");
IndexModel model = new IndexModel(sd);
@@ -29,12 +30,21 @@ public class QueryValidatorTestCase {
new QueryValidator().search(new Query("?query=mystring:foo"), execution);
try {
- new QueryValidator().search(new Query("?query=sddocname%3Aproduct%20lfmModel25KeysV0%3A9%2A%20mytensor%3A%3E0"), execution);
- fail("Excpected validation error");
+ new QueryValidator().search(new Query("?query=sddocname%3Aproduct%20lfmModel25KeysV0%3A9%2A%20mytensor1%3A%3E0"), execution);
+ fail("Expected validation error");
}
catch (IllegalArgumentException e) {
// success
- assertEquals("Cannot search 'mytensor': It is a tensor field", e.getMessage());
+ assertEquals("Cannot search 'mytensor1': It is a tensor field", e.getMessage());
+ }
+
+ try {
+ new QueryValidator().search(new Query("?query=sddocname%3Aproduct%20lfmModel25KeysV0%3A9%2A%20mytensor2%3A%3E0"), execution);
+ fail("Expected validation error");
+ }
+ catch (IllegalArgumentException e) {
+ // success
+ assertEquals("Cannot search 'mytensor2': It is a tensor field", e.getMessage());
}
}