mirror of
https://github.com/TartanLlama/optional.git
synced 2025-06-25 00:51:37 +02:00
Add test
This commit is contained in:
committed by
Deniz Evrenci
parent
b074bee409
commit
ce266d5280
@ -31,4 +31,15 @@ TEST_CASE("issue 15") {
|
||||
|
||||
o = o;
|
||||
REQUIRE(o->value == 42);
|
||||
}
|
||||
|
||||
TEST_CASE("issue 33") {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
tl::optional<int&> a = i;
|
||||
a.emplace(j);
|
||||
*a = 42;
|
||||
REQUIRE(j == 42);
|
||||
REQUIRE(*a == 42);
|
||||
REQUIRE(a.has_value());
|
||||
}
|
Reference in New Issue
Block a user