#include "catch2/catch_test_macros.hpp" #include #include "hack/mt/algorithms/max.hpp" #include "hack/mt/algorithms/sort.hpp" TEST_CASE("mt") { SECTION("max") { int a = 4, b = 5; int& c = a; REQUIRE(hack::mt::algorithms::max(4, 5) == 5); REQUIRE(hack::mt::algorithms::max(c, b) == 5); } SECTION("sort") { std::vector v { 4, 4, 6, 1, 4, 3, 2 }; std::vector vs { 1, 2, 3, 4, 4, 4, 6 }; std::forward_list l { 8, 7, 5, 9, 0, 1, 3, 2, 6, 4 }; std::forward_list ls { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; hack::mt::algorithms::sort(v); hack::mt::algorithms::sort(l); REQUIRE(v == vs); REQUIRE(l == ls); } }