blob: 6340724571a19e40735dfb6c32f47d47f51cfe89 [file] [log] [blame]
Brian Silvermanda861352019-02-02 16:42:28 -08001#include "catch.hpp"
2#include "optional.hpp"
3
4TEST_CASE("Nullopt", "[nullopt]") {
5 tl::optional<int> o1 = tl::nullopt;
6 tl::optional<int> o2{tl::nullopt};
7 tl::optional<int> o3(tl::nullopt);
8 tl::optional<int> o4 = {tl::nullopt};
9
10 REQUIRE(!o1);
11 REQUIRE(!o2);
12 REQUIRE(!o3);
13 REQUIRE(!o4);
14
15 REQUIRE(!std::is_default_constructible<tl::nullopt_t>::value);
16}