From c26ed70412dc475a7603776536647e76cb417831 Mon Sep 17 00:00:00 2001 From: Simon Brand Date: Mon, 2 Oct 2017 09:22:54 +0100 Subject: [PATCH] Nullopt tests --- tests/nullopt.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/nullopt.cpp 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); +}