aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/test
diff options
context:
space:
mode:
authorArne Juul <arnej@vespa.ai>2023-11-06 12:31:36 +0000
committerArne Juul <arnej@vespa.ai>2023-11-06 12:31:36 +0000
commit6b1804d1d8b1136e388051b15f8b0522a8a21783 (patch)
tree27357cce4cd6117e653b3e46bbe6d483d5f1ba83 /searchlib/src/test
parent036ec7b3f7a4ff3ff8b4ef7cbeabdfbfc1f72e27 (diff)
special case Generate for features access in LambdaFunctionNode
Diffstat (limited to 'searchlib/src/test')
-rw-r--r--searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationTestCase.java5
1 files changed, 4 insertions, 1 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 f9ba7552560..637e9be5fc3 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
@@ -769,6 +769,10 @@ public class EvaluationTestCase {
@Test
public void testLambdaValidation() {
EvaluationTester tester = new EvaluationTester();
+ // check that we are allowed to access dimension name "y" inside Generate
+ tester.assertEvaluates("{ {d1:0}:15, {d1:1}:150, {d1:2 }:1500 }",
+ "map(tensor0, f(x) (sum(tensor(y[6])(x*y))))",
+ "{ {d1:0}:1, {d1:1}:10, {d1:2}:100 }");
try {
tester.assertEvaluates("{ {d1:0}:1, {d1:1}:2, {d1:2 }:3 }",
"map(tensor0, f(x) (log10(x+sum(tensor0)))", "{ {d1:0}:10, {d1:1}:100, {d1:2}:1000 }");
@@ -779,7 +783,6 @@ public class EvaluationTestCase {
assertEquals("Lambda log10(x + reduce(tensor0, sum)) accesses features outside its scope: tensor0",
e.getMessage());
}
-
}
@Test