diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-12-04 09:19:29 -0800 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-12-04 09:19:29 -0800 |
commit | 5cc5b7ef1ba6627ae3cc5ff3ac62c7e09432a17a (patch) | |
tree | e2a1c3f69da6f61ad5cb8abccc4b89a6d0f8e69c /searchlib/src/test | |
parent | d3002ae703705198940203f48ba915d14bb948c4 (diff) |
Add a test
Diffstat (limited to 'searchlib/src/test')
-rw-r--r-- | searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java | 6 |
1 files changed, 6 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 376fbc85d6d..38f152d728c 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 @@ -316,6 +316,12 @@ public class EvaluationTestCase { tester.assertEvaluates("{ {x:0}:0, {x:1}:1, {x:2}:2 }", "range(x[3])"); tester.assertEvaluates("{ {x:0,y:0,z:0}:1, {x:0,y:0,z:1}:0, {x:0,y:1,z:0}:0, {x:0,y:1,z:1}:0, {x:1,y:0,z:0}:0, {x:1,y:0,z:1}:0, {x:1,y:1,z:0}:0, {x:1,y:1,z:1}:1, }", "diag(x[2],y[2],z[2])"); tester.assertEvaluates("6", "reduce(random(x[2],y[3]), count)"); + tester.assertEvaluates("tensor(x[2]):[0.0, 2.0]", + "tensor(x[2]):{{x:0}:tensor(y[2]):{{y:0}:((0+0)+a)," + + "{y:1}:((0+1)+a)}{y:0}," + + "{x:1}:tensor(y[2]):{{y:0}:((1+0)+a)," + + "{y:1}:((1+1)+a)}{y:1}" + + "}"); // tensor value tester.assertEvaluates("3.0", "tensor0{x:1}", "{ {x:0}:1, {x:1}:3 }"); |