Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/utils_tests.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils_tests.cpp b/tests/utils_tests.cpp
index 0658263..5b64e20 100644
--- a/tests/utils_tests.cpp
+++ b/tests/utils_tests.cpp
@@ -112,6 +112,16 @@ TEST(utils_tests, finally_function_ptr)
EXPECT_TRUE(j == 1);
}
+TEST(utils_tests, finally_function)
+{
+ j = 0;
+ {
+ auto _ = finally(g);
+ EXPECT_TRUE(j == 0);
+ }
+ EXPECT_TRUE(j == 1);
+}
+
TEST(utils_tests, narrow_cast)
{
int n = 120;