aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@vespa.ai>2023-09-22 16:51:35 +0200
committerJon Bratseth <bratseth@vespa.ai>2023-09-22 16:51:35 +0200
commit242359e81f1740b53f44422f90bc36a21ec516e2 (patch)
treee045182136dfe0989c483ff68160436708933c55 /container-search/src/test/java
parentad6d36794fe2a51e6f5eacde01eb648d7c76c379 (diff)
Add test
Diffstat (limited to 'container-search/src/test/java')
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/semantics/test/EquivTestCase.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/semantics/test/EquivTestCase.java b/container-search/src/test/java/com/yahoo/prelude/semantics/test/EquivTestCase.java
new file mode 100644
index 00000000000..3e2c634b7f2
--- /dev/null
+++ b/container-search/src/test/java/com/yahoo/prelude/semantics/test/EquivTestCase.java
@@ -0,0 +1,35 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.prelude.semantics.test;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * @author bratseth
+ */
+public class EquivTestCase extends RuleBaseAbstractTestCase {
+
+ public EquivTestCase() {
+ super("equiv.sr");
+ }
+
+ @Test
+ void testEquiv() {
+ assertSemantics("EQUIV \"lord of the rings\" lotr", "lotr");
+ }
+
+ @Test
+ void testEquivWithFollowingQuery() {
+ assertSemantics("AND (EQUIV \"lord of the rings\" lotr) is a movie", "lotr is a movie");
+ }
+
+ @Test
+ void testEquivWithPrecedingQuery() {
+ assertSemantics("AND a movie is (EQUIV \"lord of the rings\" lotr)", "a movie is lotr");
+ }
+
+ @Test
+ void testEquivWithSurroundingQuery() {
+ assertSemantics("AND a movie is (EQUIV \"lord of the rings\" lotr) yes", "a movie is lotr yes");
+ }
+
+}