diff --git a/histogram_internal.h b/histogram_internal.h index 7473744..2cc39b9 100644 --- a/histogram_internal.h +++ b/histogram_internal.h @@ -1,4 +1,5 @@ #ifndef HISTOGRAM_INTERNAL_H_INCLUDED #define HISTOGRAM_INTERNAL_H_INCLUDED void find_minmax(const std::vector& numbers, double& min, double& max); +std::string check_color(const std::string& color); #endif // HISTOGRAM_INTERNAL_H_INCLUDED diff --git a/svg.cpp b/svg.cpp index 84ddc82..1ec5992 100644 --- a/svg.cpp +++ b/svg.cpp @@ -2,7 +2,6 @@ #include #include "svg.h" - void svg_begin(double width, double height) { std::cout << "\n"; diff --git a/unittest.cpp b/unittest.cpp index 2b818d9..9c59d84 100644 --- a/unittest.cpp +++ b/unittest.cpp @@ -3,6 +3,7 @@ #include "doctest.h" #include "histogram_internal.h" + TEST_CASE("distinct positive numbers") { double min = 0; double max = 0; @@ -42,3 +43,15 @@ TEST_CASE("equal elements") { CHECK(min == 4); CHECK(max == 4); } + +TEST_CASE("correct input 1") { + CHECK(check_color("red") == "red"); +} + +TEST_CASE("uncorrect input 2") { + CHECK(check_color("light red") == "black"); +} + +TEST_CASE("uncorrect input 2") { + CHECK(check_color("FF0000") == "black"); +}