From 266bd8f18d2e7f8451ff349a4df3487ce5bf8a12 Mon Sep 17 00:00:00 2001 From: Simon Brand Date: Wed, 22 Aug 2018 13:47:12 +0100 Subject: [PATCH] Add issue 30 test --- tests/issues.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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); +}