diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-11-15 12:54:06 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-11-15 12:54:06 +0100 |
commit | 85ba752c81148e0076bdc00248d7a2b75632a3c8 (patch) | |
tree | 450272695d1077c4d1c3a2395d521797efbc118a /searchlib | |
parent | 61050a1678c5e2da424f6e8d21d5fa4b63fe114f (diff) |
Handle single value string buckets correctly
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java | 13 |
1 files changed, 13 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 9ba5da05a06..6064035702e 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 @@ -376,6 +376,19 @@ public class EvaluationTestCase { } @Test + public void testExpand() { + EvaluationTester tester = new EvaluationTester(); + // Add a dimension using a literal tensor + tester.assertEvaluates("tensor(d0[1], d1[3]):[1, 2, 3]", + "tensor0 * tensor(d0[1]):[1]", + "tensor(d1[3]):[1, 2, 3]"); + // Add a dimension using tensor generate + tester.assertEvaluates("tensor(d0[1], d1[3]):[1, 2, 3]", + "tensor0 * tensor(d0[1])(1)", + "tensor(d1[3]):[1, 2, 3]"); + } + + @Test public void testProgrammaticBuildingAndPrecedence() { RankingExpression standardPrecedence = new RankingExpression(new ArithmeticNode(constant(2), ArithmeticOperator.PLUS, new ArithmeticNode(constant(3), ArithmeticOperator.MULTIPLY, constant(4)))); RankingExpression oppositePrecedence = new RankingExpression(new ArithmeticNode(new ArithmeticNode(constant(2), ArithmeticOperator.PLUS, constant(3)), ArithmeticOperator.MULTIPLY, constant(4))); |