polybar-dwm/tests/unit_tests/utils/scope.cpp
2016-11-19 06:26:07 +01:00

21 lines
405 B
C++

#include "utils/scope.hpp"
int main() {
using namespace polybar;
"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);
};
}