From d1632e7a46ec1db68c1989741a0098395a355f7c Mon Sep 17 00:00:00 2001 From: Zac Hansen Date: Fri, 13 Apr 2018 01:31:06 -0700 Subject: [PATCH] added unit test for checking that std::function works --- tests/notnull_tests.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp index 3d53d31..c3fb388 100644 --- a/tests/notnull_tests.cpp +++ b/tests/notnull_tests.cpp @@ -374,3 +374,11 @@ TEST_CASE("ConfirmCopyableAndMoveablePointerTypeNotRequired") { gsl::not_null> fixed_in_place(&i); CHECK(*fixed_in_place == 5); } + + +TEST_CASE("std::function") { + gsl::not_null> nnsf([](){return 4;}); + CHECK(nnsf.get()() == 4); + std::function empty_function; + CHECK_THROWS(nnsf = empty_function); +}