1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-12-09 14:10:19 -05:00
polybar/tests/unit_tests/utils/scope.cpp

21 lines
405 B
C++
Raw Normal View History

2016-10-24 19:47:00 -04:00
#include "utils/scope.hpp"
int main() {
2016-11-19 00:22:44 -05:00
using namespace polybar;
2016-10-24 19:47:00 -04:00
"on_exit"_test = [] {
auto flag = false;
{
expect(!flag);
auto handler = scope_util::make_exit_handler<>([&] { flag = true; });
expect(!flag);
{
auto handler = scope_util::make_exit_handler<>([&] { flag = true; });
}
expect(flag);
flag = false;
}
expect(flag);
};
}