mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
added unit test for checking that std::function works
This commit is contained in:
parent
63cf89f340
commit
d1632e7a46
@ -374,3 +374,11 @@ TEST_CASE("ConfirmCopyableAndMoveablePointerTypeNotRequired") {
|
|||||||
gsl::not_null<UncopyableUnmovablePointerLikeType<int>> fixed_in_place(&i);
|
gsl::not_null<UncopyableUnmovablePointerLikeType<int>> fixed_in_place(&i);
|
||||||
CHECK(*fixed_in_place == 5);
|
CHECK(*fixed_in_place == 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE("std::function") {
|
||||||
|
gsl::not_null<std::function<int()>> nnsf([](){return 4;});
|
||||||
|
CHECK(nnsf.get()() == 4);
|
||||||
|
std::function<int()> empty_function;
|
||||||
|
CHECK_THROWS(nnsf = empty_function);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user