From 317690db074feb306b9c830f3b9aa519005ba05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Chocholat=C3=BD?= Date: Wed, 13 Sep 2023 13:10:17 +0200 Subject: [PATCH] Check erasing from OrdVector --- tests/ord-vector.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/ord-vector.cc b/tests/ord-vector.cc index af6ac28c3..6660c195a 100644 --- a/tests/ord-vector.cc +++ b/tests/ord-vector.cc @@ -22,7 +22,7 @@ using namespace mata::utils; -TEST_CASE("mata::utils::OrdVector::remove()") { +TEST_CASE("mata::utils::OrdVector::erase()") { using OrdVectorT = OrdVector; OrdVectorT set{ 1, 2, 3, 4, 6 }; set.erase(3); @@ -35,6 +35,14 @@ TEST_CASE("mata::utils::OrdVector::remove()") { set.erase(1); set.erase(6); CHECK(set.empty()); + set.push_back(3); + CHECK(set == OrdVectorT{ 3 }); + set.erase(3); + CHECK(set.empty()); + CHECK_THROWS(set.erase(0)); + set.emplace_back(3); + set.emplace_back(4); + CHECK(set == OrdVectorT{ 3, 4 }); CHECK_THROWS(set.erase(0)); }