diff --git a/tests/test_Array.cpp b/tests/test_Array.cpp index c2ec98c99db1774873e9178ebc2afa0065251a42..e6a31ae8953ebd908e0b0e36e4b3e567b1eb3826 100644 --- a/tests/test_Array.cpp +++ b/tests/test_Array.cpp @@ -6,6 +6,7 @@ #include <vector> #include <set> +#include <list> // Instantiate to ensure full coverage is performed template class Array<int>; @@ -162,6 +163,7 @@ TEST_CASE("Array", "[utils]") { (v_array[2] == 5) and (v_array[3] == 3))); } } + { std::vector<int> w; { @@ -175,7 +177,7 @@ TEST_CASE("Array", "[utils]") { } { - std::set<int> s{4,2,5,3,1}; + std::set<int> s{4,2,5,3,1,3,2}; Array<int> s_array = convert_to_array(s); REQUIRE(s_array.size() == s.size()); @@ -183,6 +185,27 @@ TEST_CASE("Array", "[utils]") { (s_array[2] == 3) and (s_array[3] == 4) and (s_array[4] == 5))); } + + { + std::multiset<int> ms{4,2,5,3,1,3,2}; + Array<int> ms_array = convert_to_array(ms); + + REQUIRE(ms_array.size() == ms.size()); + REQUIRE(((ms_array[0] == 1) and (ms_array[1] == 2) and + (ms_array[2] == 2) and (ms_array[3] == 3) and + (ms_array[4] == 3) and (ms_array[5] == 4) and + (ms_array[6] == 5))); + } + + { + std::list<int> l{1,3,5,6,2}; + Array<int> l_array = convert_to_array(l); + + REQUIRE(l_array.size() == l.size()); + REQUIRE(((l_array[0] == 1) and (l_array[1] == 3) and + (l_array[2] == 5) and (l_array[3] == 6) and + (l_array[4] == 2))); + } } #ifndef NDEBUG