From 37124aec8f740ba64101343c607c82e900d86a71 Mon Sep 17 00:00:00 2001 From: SukhotinMD Date: Thu, 29 May 2025 04:03:29 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2:=20=D0=BA?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B5=20=D0=BD=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=85=D0=BE=D0=B4=D1=8F=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProgUit Lab1/unittest.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ProgUit Lab1/unittest.cpp b/ProgUit Lab1/unittest.cpp index 11926d1..079375d 100644 --- a/ProgUit Lab1/unittest.cpp +++ b/ProgUit Lab1/unittest.cpp @@ -12,3 +12,31 @@ TEST_CASE("distinct positive numbers") { CHECK(min == 1); CHECK(max == 2); } +TEST_CASE("empty vector") { + double min = 0; + double max = 0; + find_minmax({}, min, max); + CHECK(min == 1); + CHECK(max == 2); +} +TEST_CASE("you fill so lonly") { + double min = 0; + double max = 0; + find_minmax({ 1 }, min, max); + CHECK(min == 1); + CHECK(max == 2); +} +TEST_CASE("negative numbers") { + double min = 0; + double max = 0; + find_minmax({ -1, -2 }, min, max); + CHECK(min == 1); + CHECK(max == 2); +} +TEST_CASE("twins") { + double min = 0; + double max = 0; + find_minmax({ 1, 1 }, min, max); + CHECK(min == 1); + CHECK(max == 2); +} \ No newline at end of file