mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
20 lines
405 B
C++
20 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);
|
|
};
|
|
}
|