Fix #34
This commit is contained in:
1 parent
7b7519ff4a
commit
03689e9d21
2 files changed
+16
-7
No files matched your search
@@ -80,3 +80,14 @@ TEST_CASE("Issue 33", "[issues.33]") {
|
||||
res = res.map_error([](int i) { return 42; });
|
||||
REQUIRE(res.error() == 42);
|
||||
}
|
||||
|
||||
|
||||
tl::expected<void, std::string> voidWork() { return {}; }
|
||||
tl::expected<int, std::string> work2() { return 42; }
|
||||
void errorhandling(std::string){}
|
||||
|
||||
TEST_CASE("Issue 34", "[issues.34]") {
|
||||
tl::expected <int, std::string> result = voidWork ()
|
||||
.and_then (work2);
|
||||
result.map_error ([&] (std::string result) {errorhandling (result);});
|
||||
}
|
||||
Reference in new issue
Block a user