Nullopt tests

This commit is contained in:
Simon Brand
2017-10-02 09:22:54 +01:00
parent 06adccc8c7
commit c26ed70412

16
tests/nullopt.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include "catch.hpp"
#include "optional.hpp"
TEST_CASE("Nullopt", "[nullopt]") {
tl::optional<int> o1 = tl::nullopt;
tl::optional<int> o2{tl::nullopt};
tl::optional<int> o3(tl::nullopt);
tl::optional<int> o4 = {tl::nullopt};
REQUIRE(!o1);
REQUIRE(!o2);
REQUIRE(!o3);
REQUIRE(!o4);
REQUIRE(!std::is_default_constructible<tl::nullopt_t>::value);
}