forked from TartanLlama/optional
More tests
This commit is contained in:
@ -122,7 +122,7 @@ TEST_CASE("Monadic operations", "[monadic]") {
|
||||
|
||||
// callable which returns a reference
|
||||
tl::optional<int> o38 = 42;
|
||||
auto o38r = o38.map([](int& i) -> const int& { return i; });
|
||||
auto o38r = o38.map([](int &i) -> const int & { return i; });
|
||||
REQUIRE(o38r);
|
||||
REQUIRE(*o38r == 42);
|
||||
}
|
||||
|
@ -41,4 +41,6 @@ TEST_CASE("Make optional", "[make_optional]") {
|
||||
auto i = 42;
|
||||
auto o6 = tl::make_optional<int&>(i);
|
||||
REQUIRE((std::is_same<decltype(o6), tl::optional<int&>>::value));
|
||||
REQUIRE(o6);
|
||||
REQUIRE(*o6 == 42);
|
||||
}
|
||||
|
Reference in New Issue
Block a user