diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-02-15 13:37:41 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2019-02-15 13:37:41 +0000 |
commit | 28cf7e4bc167b000d83f4511930261f35fd7159e (patch) | |
tree | dc0dd5e15774e1f05e67c03047f9ab77ad323f3b /document | |
parent | 91ae7785e7fc132d9e3959be5810a488f125ac84 (diff) |
Test tensor modify update with add and multiply.
Diffstat (limited to 'document')
-rw-r--r-- | document/src/tests/documentupdatetestcase.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index b71c270d3e8..1087c319765 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -1043,15 +1043,27 @@ void DocumentUpdateTest::tensor_modify_update_can_be_applied() { TensorUpdateFixture f; - f.assertApplyUpdate(f.spec().add({{"x", "a"}}, 2) - .add({{"x", "b"}}, 3), + auto baseLine = f.spec().add({{"x", "a"}}, 2) + .add({{"x", "b"}}, 3); + f.assertApplyUpdate(baseLine, TensorModifyUpdate(TensorModifyUpdate::Operation::REPLACE, f.makeTensor(f.spec().add({{"x", "b"}}, 5) .add({{"x", "c"}}, 7))), - f.spec().add({{"x", "a"}}, 2) .add({{"x", "b"}}, 5)); + + f.assertApplyUpdate(baseLine, + TensorModifyUpdate(TensorModifyUpdate::Operation::ADD, + f.makeTensor(f.spec().add({{"x", "b"}}, 5))), + f.spec().add({{"x", "a"}}, 2) + .add({{"x", "b"}}, 8)); + + f.assertApplyUpdate(baseLine, + TensorModifyUpdate(TensorModifyUpdate::Operation::MUL, + f.makeTensor(f.spec().add({{"x", "b"}}, 5))), + f.spec().add({{"x", "a"}}, 2) + .add({{"x", "b"}}, 15)); } void |