diff options
author | Geir Storli <geirst@yahooinc.com> | 2023-08-23 15:32:58 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2023-08-23 15:32:58 +0000 |
commit | b9c6ad6890e2c571878982abc9cd3f1bc9426d83 (patch) | |
tree | 937fc2fa3545807f16ba1c3c3cd815da30499db6 /document/src/tests | |
parent | 2dd6924585799a8d1bc5319093871e586b659add (diff) |
Extend modify update operation in Java to match the new C++ behavior.
This creates non-existing sub-spaces with default cell value first.
Diffstat (limited to 'document/src/tests')
-rw-r--r-- | document/src/tests/tensor_fieldvalue/partial_modify/partial_modify_test.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/document/src/tests/tensor_fieldvalue/partial_modify/partial_modify_test.cpp b/document/src/tests/tensor_fieldvalue/partial_modify/partial_modify_test.cpp index bf0f893b901..bf780dba5d3 100644 --- a/document/src/tests/tensor_fieldvalue/partial_modify/partial_modify_test.cpp +++ b/document/src/tests/tensor_fieldvalue/partial_modify/partial_modify_test.cpp @@ -129,6 +129,12 @@ TEST(PartialModifyTest, partial_modify_with_defauls) { "tensor(x{},y[3]):{{x:\"a\",y:0}:9,{x:\"a\",y:1}:4,{x:\"a\",y:2}:5," "{x:\"b\",y:0}:1,{x:\"b\",y:1}:8,{x:\"b\",y:2}:9," "{x:\"c\",y:0}:10,{x:\"c\",y:1}:1,{x:\"c\",y:2}:1}"); + + // NOTE: The specified default cell value doesn't have any effect for tensors with only indexed dimensions, + // as the dense subspace is always represented (with default cell value 0.0). + expect_modify_with_defaults("tensor(x[3]):{{x:0}:2}", "tensor(x{}):{{x:\"1\"}:3}", + operation::Add::f, 2.0, + "tensor(x[3]):{{x:0}:2,{x:1}:3,{x:2}:0}"); } std::vector<std::pair<vespalib::string,vespalib::string>> bad_layouts = { |