From 0aeeb4226fa3d8d13ea17755edf55663877bfa2a Mon Sep 17 00:00:00 2001 From: LiTekho Date: Mon, 24 Apr 2023 16:02:39 +0300 Subject: [PATCH] code: test update --- unitest.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 unitest.cpp diff --git a/unitest.cpp b/unitest.cpp new file mode 100644 index 0000000..b33aece --- /dev/null +++ b/unitest.cpp @@ -0,0 +1,18 @@ +#define DOCTEST_CONFIG_NO_MULTITHREADING +#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +#include "doctest.h" +#include "histogram_internal.h" +#include +#include +TEST_CASE("distinct positive numbers") +{ + double min = 0; + double max = 0; + std::vectorv{1}; + CHECK(v.size() != 0); + CHECK(v.size() != 1); + find_minmax(v, min, max); + CHECK(min == 1); + CHECK(max == 2); + CHECK(min != max); +}