diff options
author | Arne Juul <arnej@yahooinc.com> | 2024-02-28 11:32:01 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2024-02-28 11:32:01 +0000 |
commit | 84d51ea72e5684c715c7cec89215ce7ada1ab363 (patch) | |
tree | 6e94e14b69e00d71cfc899d82f0c1bc78c4e3ed3 /config-model | |
parent | 6ad14f5a685cbfe3acabcc477e1771ada79c961c (diff) |
add unit test for zcurve rewrite
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/test/java/com/yahoo/schema/derived/IndexingScriptTestCase.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/schema/derived/IndexingScriptTestCase.java b/config-model/src/test/java/com/yahoo/schema/derived/IndexingScriptTestCase.java index 6bfb67b3011..a35dda28e16 100644 --- a/config-model/src/test/java/com/yahoo/schema/derived/IndexingScriptTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/derived/IndexingScriptTestCase.java @@ -40,4 +40,23 @@ public class IndexingScriptTestCase { verifyIndexingScript(false); verifyIndexingScript(true); } + + private void verifyZcurveScript(boolean isStreaming) { + VespaModel model = IndexInfoTestCase.createModel(TEST, + """ + field f type position { indexing: attribute } + """); + Schema schema = model.getSearchClusters().get(0).schemas().get(TEST).fullSchema(); + IlscriptsConfig cfg = ilscriptsConfig(schema, isStreaming); + assertEquals(1, cfg.ilscript().size()); + assertEquals(1, cfg.ilscript(0).content().size()); + String exp_f = isStreaming ? "attribute f" : "zcurve | attribute f_zcurve"; + assertEquals("clear_state | guard { input f | " + exp_f + "; }", cfg.ilscript(0).content(0)); + } + + @Test + void testThatZcurveIsRewrittenFromStreaming() { + verifyZcurveScript(false); + verifyZcurveScript(true); + } } |