diff --git a/tests/issues.cpp b/tests/issues.cpp index b43edaa..dcb37d8 100644 --- a/tests/issues.cpp +++ b/tests/issues.cpp @@ -23,18 +23,18 @@ TEST_CASE("Issue 17", "[issues.17]") { intermediate_result.and_then(operation2); } -struct a{}; -struct b:a{}; +struct a {}; +struct b : a {}; TEST_CASE("Issue 26", "[issues.26]") { - tl::expected exp = tl::expected(tl::unexpect, 0); - REQUIRE(!exp.has_value()); + tl::expected exp = tl::expected(tl::unexpect, 0); + REQUIRE(!exp.has_value()); } struct foo { foo() = default; - foo(foo&) = delete; - foo(foo&&) {}; + foo(foo &) = delete; + foo(foo &&){}; }; TEST_CASE("Issue 29", "[issues.29]") { @@ -43,3 +43,12 @@ TEST_CASE("Issue 29", "[issues.29]") { tl::expected, int> ov = std::move(v); REQUIRE(ov->size() == 1); } + +tl::expected error() { + return tl::make_unexpected(std::string("error1 ")); +} +std::string maperror(std::string s) { return s + "maperror "; } + +TEST_CASE("Issue 30", "[issues.30]") { + error().map_error(maperror); +}