mirror of
https://github.com/polybar/polybar.git
synced 2024-12-09 14:10:19 -05:00
21 lines
408 B
C++
21 lines
408 B
C++
|
#include "utils/scope.hpp"
|
||
|
|
||
|
int main() {
|
||
|
using namespace lemonbuddy;
|
||
|
|
||
|
"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);
|
||
|
};
|
||
|
}
|