diff --git a/doctest.h b/doctest.h index c8535fa..5c754cd 100644 --- a/doctest.h +++ b/doctest.h @@ -1,6 +1,3 @@ -#ifndef DOCTEST_H_INCLUDED -#define DOCTEST_H_INCLUDED - // ====================================================================== lgtm [cpp/missing-header-guard] // == DO NOT MODIFY THIS FILE BY HAND - IT IS AUTO GENERATED BY CMAKE! == // ====================================================================== @@ -7107,5 +7104,3 @@ DOCTEST_SUPPRESS_COMMON_WARNINGS_POP #undef NOMINMAX #undef DOCTEST_UNDEF_NOMINMAX #endif // DOCTEST_UNDEF_NOMINMAX - -#endif // DOCTEST_H_INCLUDED diff --git a/unittest.cpp b/unittest.cpp index a9ba7e5..7fb242b 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -10,3 +10,20 @@ TEST_CASE("distinct positive numbers") { CHECK(min == 1); CHECK(max == 2); } + + +TEST_CASE("distinct negative numbers"){ + double min = 0; + double max = 0; + find_minmax({-1, -2}, min, max); + CHECK(min == -2); + CHECK(max == -1); +} +TEST_CASE("vector of the same elements"){ + double min = 0; + double max = 0; + find_minmax({3,3,3}, min, max); + CHECK(min == 3); + CHECK(max == 3); +} +