From d83bbfd7f3db4c97bd21c9c353c48af3308be446 Mon Sep 17 00:00:00 2001 From: TiutinMO Date: Sun, 15 Jun 2025 00:51:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D1=8E?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D1=82=D0=B5=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unittest.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/unittest.cpp b/unittest.cpp index bf37c5e..1f47d26 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -11,34 +11,34 @@ TEST_CASE("distinct positive numbers") { CHECK(max == 2); } - -TEST_CASE("distinct negative numbers"){ +TEST_CASE("empty array") { double min = 0; double max = 0; - find_minmax({-1, -2}, min, max); - CHECK(min == -2); - CHECK(max == -1); + find_minmax({}, min, max); + CHECK(min == 0); + CHECK(max == 0); } -TEST_CASE("vector of the same elements"){ + +TEST_CASE("array with a single element") { double min = 0; double max = 0; - find_minmax({3,3,3}, min, max); - CHECK(min == 3); - CHECK(max == 3); + find_minmax({1}, min, max); + CHECK(min == 1); + CHECK(max == 1); } -TEST_CASE("single element vector") { +TEST_CASE("array of negative elements") { double min = 0; double max = 0; - find_minmax({7}, min, max); - CHECK(min == 7); - CHECK(max == 7); + find_minmax({-1, -2}, min, max); + CHECK(min == -2); + CHECK(max == -1); } -TEST_CASE("empty vector") { +TEST_CASE("array of identical elements") { double min = 0; double max = 0; - find_minmax({}, min, max); - CHECK(min == 0); - CHECK(max == 0); + find_minmax({1, 1}, min, max); + CHECK(min == 1); + CHECK(max == 1); }