diff --git a/unittest.cpp b/unittest.cpp index 0acaa65..851208c 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -26,3 +26,19 @@ TEST_CASE("same elements"){ CHECK(min == max); CHECK(max == min); } + +TEST_CASE("only one number"){ + double min = 0; + double max = 0; + find_minmax({1}, min, max); + CHECK(min == 1); + CHECK(max == 1); +} + +TEST_CASE("distinct negative numbers") { + double min = 0; + double max = 0; + find_minmax({0, -2}, min, max); + CHECK(min == -2); + CHECK(max == 0); +}