summaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-02-24 18:32:38 +0100
committerJon Bratseth <bratseth@oath.com>2018-02-24 18:32:38 +0100
commit6cb1c29a8076f22415ef448bd114dfec9b37e00e (patch)
tree6c6377915ab00cb06eac66d46ae3470edfc6f10a /config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java
parent180bc0034ae5ba6f2b5644a7c520486bbcc511bd (diff)
Cleanup and more type inference
- Use a type context in TensorTransformer - Correct Join.outputType - Understand tensorFromLabels and tensorFromWeightedSet - Don't wrap simple tensor arguments in constant()
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java')
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java
index 054c9220225..098594dd06e 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/TensorTransformTestCase.java
@@ -112,7 +112,7 @@ public class TensorTransformTestCase extends SearchDefinitionTestCase {
}
@Test
- public void requireThatMaxAndMinWithTensoresReturnedFromMacrosAreReplaced() throws ParseException {
+ public void requireThatMaxAndMinWithTensorsReturnedFromMacrosAreReplaced() throws ParseException {
assertTransformedExpression("reduce(rankingExpression(returns_tensor),max,x)",
"max(returns_tensor,x)");
assertTransformedExpression("reduce(rankingExpression(wraps_returns_tensor),max,x)",
@@ -123,17 +123,16 @@ public class TensorTransformTestCase extends SearchDefinitionTestCase {
"max(returns_tensor_with_arg(attribute(tensor_field_1)),x)");
}
-
private void assertTransformedExpression(String expected, String original) throws ParseException {
for (Pair<String, String> rankPropertyExpression : buildSearch(original)) {
String rankProperty = rankPropertyExpression.getFirst();
- if (rankProperty.equals("rankingExpression(firstphase).rankingScript")) {
+ if (rankProperty.equals("rankingExpression(testexpression).rankingScript")) {
String rankExpression = censorBindingHash(rankPropertyExpression.getSecond().replace(" ",""));
assertEquals(expected, rankExpression);
return;
}
}
- fail("No 'rankingExpression(firstphase).rankingScript' property produced");
+ fail("No 'rankingExpression(testexpression).rankingScript' property produced");
}
private List<Pair<String, String>> buildSearch(String expression) throws ParseException {
@@ -193,7 +192,7 @@ public class TensorTransformTestCase extends SearchDefinitionTestCase {
" macro tensor_inheriting() {\n" +
" expression: base_tensor\n" +
" }\n" +
- " first-phase {\n" +
+ " macro testexpression() {\n" +
" expression: " + expression + "\n" +
" }\n" +
" }\n" +