mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-05 21:24:27 -04:00
parent
53fcdedb88
commit
00667cecf9
7 changed files with 472 additions and 192 deletions
|
@ -34,9 +34,28 @@ TEST_CASE("Instance with value should be valid.") {
|
|||
REQUIRE(o.is_valid());
|
||||
}
|
||||
|
||||
TEST_CASE("Instance with value should be return true.") {
|
||||
Optional<int> o{1};
|
||||
REQUIRE((bool)o);
|
||||
}
|
||||
|
||||
TEST_CASE("value() should return value.") {
|
||||
Optional<int> o{1};
|
||||
REQUIRE(o.value() == 1);
|
||||
}
|
||||
|
||||
TEST_CASE("operator* should return value.") {
|
||||
Optional<int> o{1};
|
||||
REQUIRE(*o == 1);
|
||||
}
|
||||
|
||||
TEST_CASE("operator-> should return value members.") {
|
||||
struct S {
|
||||
int i;
|
||||
};
|
||||
|
||||
Optional<S> o{S{1}};
|
||||
REQUIRE(o->i == 1);
|
||||
}
|
||||
|
||||
TEST_SUITE_END();
|
Loading…
Add table
Add a link
Reference in a new issue