From feb2d3f8e67b68696f299e427d51a2c597c9ddbe Mon Sep 17 00:00:00 2001 From: Oleg <bobrikov.oleg@gmail.com> Date: Mon, 28 Aug 2023 20:00:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BB=D1=83=D1=87=D0=B0=D0=B8=20=D0=BC?= =?UTF-8?q?=D0=BE=D0=B4=D1=83=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unittest.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/unittest.cpp b/unittest.cpp index a9ba7e5..b4062a4 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -10,3 +10,31 @@ TEST_CASE("distinct positive numbers") { CHECK(min == 1); CHECK(max == 2); } +TEST_CASE("distinct positive numbers") { + double min = 0; + double max = 0; + find_minmax({}, min, max); + CHECK(min == 0); + CHECK(max == 0); +} +TEST_CASE("distinct positive numbers") { + double min = 0; + double max = 0; + find_minmax({1}, min, max); + CHECK(min == 1); + CHECK(max == 1); +} +TEST_CASE("distinct positive numbers") { + double min = 0; + double max = 0; + find_minmax({-1, 2}, min, max); + CHECK(min == -1); + CHECK(max == 2); +} +TEST_CASE("distinct positive numbers") { + double min = 0; + double max = 0; + find_minmax({2, 2, 2, 2}, min, max); + CHECK(min == 2); + CHECK(max == 2); +}