diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-11-28 13:02:02 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-11-28 13:02:02 +0100 |
commit | 7cbf6c75962e44f76c64c2442b45c83fe275fdcb (patch) | |
tree | 608e5d93e62e55c24bddca35f874d5100466e214 /config-model | |
parent | e12e2d54042b2aeca632ee630f0d67695dfb2f1b (diff) |
Always output tensor type in toString
This allows us to always restore a tensor accurately from
its toString form.
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java index 48f2bf43e81..5c96635fd8f 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorTestCase.java @@ -27,7 +27,7 @@ public class RankingExpressionWithTensorTestCase { " }"); f.compileRankProfile("my_profile"); f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile"); - f.assertRankProperty("{{x:1,y:2}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile"); + f.assertRankProperty("tensor(x{},y{}):{{x:1,y:2}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile"); f.assertRankProperty("tensor(x{},y{})", "constant(my_tensor).type", "my_profile"); } @@ -50,7 +50,7 @@ public class RankingExpressionWithTensorTestCase { " }"); f.compileRankProfile("my_profile"); f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile"); - f.assertRankProperty("{{x:1,y:2}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile"); + f.assertRankProperty("tensor(x{},y{}):{{x:1,y:2}:1.0,{x:2,y:1}:2.0}", "constant(my_tensor).value", "my_profile"); f.assertRankProperty("tensor(x{},y{})", "constant(my_tensor).type", "my_profile"); } @@ -69,7 +69,7 @@ public class RankingExpressionWithTensorTestCase { " }"); f.compileRankProfile("my_profile"); f.assertSecondPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile"); - f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); + f.assertRankProperty("tensor(x{}):{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile"); } @@ -90,7 +90,7 @@ public class RankingExpressionWithTensorTestCase { " }"); f.compileRankProfile("my_profile"); f.assertFirstPhaseExpression("reduce(constant(my_tensor), sum)", "my_profile"); - f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); + f.assertRankProperty("tensor(x{}):{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile"); } @@ -113,7 +113,7 @@ public class RankingExpressionWithTensorTestCase { f.compileRankProfile("my_profile"); f.assertFirstPhaseExpression("5.0 + my_macro", "my_profile"); f.assertFunction("reduce(constant(my_tensor), sum)", "my_macro", "my_profile"); - f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); + f.assertRankProperty("tensor(x{}):{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile"); } @@ -134,7 +134,7 @@ public class RankingExpressionWithTensorTestCase { " }"); f.compileRankProfile("my_profile"); f.assertFirstPhaseExpression("3.0 + reduce(constant(my_tensor), sum) + 5.0", "my_profile"); - f.assertRankProperty("{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); + f.assertRankProperty("tensor(x{}):{{x:1}:1.0}", "constant(my_tensor).value", "my_profile"); f.assertRankProperty("tensor(x{})", "constant(my_tensor).type", "my_profile"); } |