diff --git a/test/ResultTest.cpp b/test/ResultTest.cpp index 43e9f35..e84d093 100644 --- a/test/ResultTest.cpp +++ b/test/ResultTest.cpp @@ -25,7 +25,12 @@ utils::resultplus(int x, int y) { } utils::resulterror_to_string(math_error err) { - return utils::error(std::string("error")); + switch (err) { + case math_error::DIVISION_BY_ZERO: + return utils::error(std::string("division by zero error")); + default: + return utils::error(std::string("unknown error")); + } } } @@ -76,7 +81,7 @@ TEST_CASE("Result tests", "[result]") { REQUIRE(!res2); REQUIRE(!res2.is_ok()); REQUIRE(res2.is_error()); - REQUIRE((res2.err() == "error")); + REQUIRE((res2.err() == "division by zero error")); res = test::divide(4, 2) .and_then([](const auto &val) { return test::multiply(val, 5); })