From ce266d52807c0d9d78d946c86267422193c6dd11 Mon Sep 17 00:00:00 2001 From: Simon Brand Date: Mon, 8 Jul 2019 11:49:21 +0100 Subject: [PATCH] Add test --- tests/issues.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/issues.cpp b/tests/issues.cpp index d5672a3..1f465e1 100644 --- a/tests/issues.cpp +++ b/tests/issues.cpp @@ -31,4 +31,15 @@ TEST_CASE("issue 15") { o = o; REQUIRE(o->value == 42); +} + +TEST_CASE("issue 33") { + int i = 0; + int j = 0; + tl::optional a = i; + a.emplace(j); + *a = 42; + REQUIRE(j == 42); + REQUIRE(*a == 42); + REQUIRE(a.has_value()); } \ No newline at end of file