diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-10-27 13:09:00 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-10-27 13:09:00 +0200 |
commit | 56bea1297fc83893b955a21d45e3ac04a022ea52 (patch) | |
tree | 8f782e0d16688cbd3d00165d296f15789ea32f01 /container-search/src/test/java/com/yahoo/prelude | |
parent | 5edcd157eb99da504d96abd8687b24fdf448fabb (diff) |
Add missing cloning
Diffstat (limited to 'container-search/src/test/java/com/yahoo/prelude')
-rw-r--r-- | container-search/src/test/java/com/yahoo/prelude/test/QueryTestCase.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/test/QueryTestCase.java b/container-search/src/test/java/com/yahoo/prelude/test/QueryTestCase.java index 526f520a583..d9e3cf84726 100644 --- a/container-search/src/test/java/com/yahoo/prelude/test/QueryTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/test/QueryTestCase.java @@ -8,6 +8,7 @@ import com.yahoo.prelude.Index; import com.yahoo.prelude.IndexFacts; import com.yahoo.prelude.IndexModel; import com.yahoo.prelude.SearchDefinition; +import com.yahoo.prelude.query.BoolItem; import com.yahoo.prelude.query.WordItem; import com.yahoo.search.Query; import com.yahoo.search.query.Sorting; @@ -32,6 +33,14 @@ import static org.junit.Assert.*; public class QueryTestCase { @Test + public void testBoolItem() { + var original = new BoolItem(false); + var cloned = original.clone(); + assertNotSame(original, cloned); + assertEquals(original, cloned); + } + + @Test public void testSimpleQueryParsing () { Query q = newQuery("/search?query=foobar&offset=10&hits=20"); assertEquals("foobar",((WordItem) q.getModel().getQueryTree().getRoot()).getWord()); |