diff options
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/testSparseVector.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/testSparseVector.cxx b/test/unit/testSparseVector.cxx index ac60d3421..ce3b9706b 100644 --- a/test/unit/testSparseVector.cxx +++ b/test/unit/testSparseVector.cxx @@ -233,4 +233,20 @@ TEST_CASE("SparseTextString") { REQUIRE("" == st.ValueAt(2)); st.Check(); } + + SECTION("SetAndMoveString") { + st.InsertSpace(0, 2); + REQUIRE(2u == st.Length()); + std::string s24("24"); + st.SetValueAt(0, s24); + REQUIRE("24" == s24); // Not moved from + REQUIRE("" == st.ValueAt(-1)); + REQUIRE("24" == st.ValueAt(0)); + REQUIRE("" == st.ValueAt(1)); + std::string s25("25"); + st.SetValueAt(1, std::move(s25)); + REQUIRE("" == s25); // moved from + REQUIRE("25" == st.ValueAt(1)); + } + } |