diff --git a/tests/nullopt.cpp b/tests/nullopt.cpp new file mode 100644 index 0000000..6340724 --- /dev/null +++ b/tests/nullopt.cpp @@ -0,0 +1,16 @@ +#include "catch.hpp" +#include "optional.hpp" + +TEST_CASE("Nullopt", "[nullopt]") { + tl::optional o1 = tl::nullopt; + tl::optional o2{tl::nullopt}; + tl::optional o3(tl::nullopt); + tl::optional o4 = {tl::nullopt}; + + REQUIRE(!o1); + REQUIRE(!o2); + REQUIRE(!o3); + REQUIRE(!o4); + + REQUIRE(!std::is_default_constructible::value); +}