summaryrefslogtreecommitdiffstats
path: root/searchlib/src/test
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-05-16 10:49:53 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2017-05-16 10:49:53 +0200
commit8285c36507b265a078b7c87a9dac6881bb1f91e4 (patch)
tree0af76d796cf9e172a7838146f7e5e514b7d07e90 /searchlib/src/test
parent69687fae0357786e04338230c51c9f9abf40c41b (diff)
Remove expired compatibility code
Diffstat (limited to 'searchlib/src/test')
-rw-r--r--searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java b/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java
index d0a188c0760..deaf1070d45 100644
--- a/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java
+++ b/searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java
@@ -265,6 +265,16 @@ public class EvaluationTestCase {
tester.assertEvaluates("1.0", "sum(tensor0 * tensor1 + 0.5)", "{}", "{ {x:0}:1, {x:1}:1 }");
tester.assertEvaluates("0.0", "sum(tensor0 * tensor1 + 0.5)", "tensor(x{}):{}", "{ {x:0}:1, {x:1}:1 }");
+ tester.assertEvaluates("1",
+ "reduce(join(tensor0, tensor1, f(x,y) (if(x > y, 1.0, 0.0))), sum, tag) == reduce(tensor0, count, tag)",
+ "tensor(tag{}):{{tag:tag1}:10, {tag:tag2}:20}", "{5}");
+ tester.assertEvaluates("0",
+ "reduce(join(tensor0, tensor1, f(x,y) (if(x > y, 1.0, 0.0))), sum, tag) == reduce(tensor0, count, tag)",
+ "tensor(tag{}):{{tag:tag1}:10, {tag:tag2}:20}", "{15}");
+ tester.assertEvaluates("0",
+ "reduce(join(tensor0, tensor1, f(x,y) (if(x > y, 1.0, 0.0))), sum, tag) == reduce(tensor0, count, tag)",
+ "tensor(tag{}):{{tag:tag1}:10, {tag:tag2}:20}", "{25}");
+
// tensor result dimensions are given from argument dimensions, not the resulting values
tester.assertEvaluates("tensor(x{}):{}", "tensor0 * tensor1", "{ {x:0}:1 }", "tensor(x{}):{ {x:1}:1 }");
tester.assertEvaluates("tensor(x{},y{}):{}", "tensor0 * tensor1", "{ {x:0}:1 }", "tensor(x{},y{}):{ {x:1,y:0}:1, {x:2,y:1}:1 }");