From 22fa6361a13749a39431037ce69080d6085b55dc Mon Sep 17 00:00:00 2001 From: ShinkarenkoVA Date: Mon, 6 May 2024 14:24:21 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D1=82=D0=B5=D1=81=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unittest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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); +}