Commit 39ef9832 authored by Sven Over's avatar Sven Over Committed by Facebook Github Bot

also test Function move construction from empty Function

Summary: The `Emptiness_T` test already tests the emptiness of a default-constructed Function as well as one that was assigned an empty Function. This diff adds a test for a Function that was move-constructed from an empty Function.

Reviewed By: shixiao

Differential Revision: D8818468

fbshipit-source-id: 3f0e04b9f0f44df2de45fc972a2d26e12adc7362
parent 787dc636
...@@ -255,6 +255,12 @@ TEST(Function, Emptiness_T) { ...@@ -255,6 +255,12 @@ TEST(Function, Emptiness_T) {
EXPECT_EQ(nullptr, h); EXPECT_EQ(nullptr, h);
EXPECT_FALSE(h); EXPECT_FALSE(h);
EXPECT_THROW(h(101), std::bad_function_call); EXPECT_THROW(h(101), std::bad_function_call);
Function<int(int)> i{Function<int(int)>{}};
EXPECT_EQ(i, nullptr);
EXPECT_EQ(nullptr, i);
EXPECT_FALSE(i);
EXPECT_THROW(i(107), std::bad_function_call);
} }
// TEST ===================================================================== // TEST =====================================================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment