aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp')
-rw-r--r--searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
index 892be2c874f..8c3ce4c5031 100644
--- a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
+++ b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
@@ -436,6 +436,15 @@ TEST_F("require that tensor modify update is applied",
f.assertTensor(TensorSpec(f.type).add({{"x", 0}}, 7).add({{"x", 1}}, 5));
}
+TEST_F("require that tensor modify update with 'create: true' is applied to non-existing tensor",
+ TensorFixture<DenseTensorAttribute>("tensor(x[2])", "dense_tensor"))
+{
+ f.applyValueUpdate(*f.attribute, 1,
+ std::make_unique<TensorModifyUpdate>(TensorModifyUpdate::Operation::ADD,
+ makeTensorFieldValue(TensorSpec("tensor(x{})").add({{"x", "1"}}, 3)), 0.0));
+ f.assertTensor(TensorSpec(f.type).add({{"x", 0}}, 0).add({{"x", 1}}, 3));
+}
+
TEST_F("require that tensor add update is applied",
TensorFixture<SerializedFastValueAttribute>("tensor(x{})", "sparse_tensor"))
{