memgraph/tests/unit/utils_on_scope_exit.cpp
antonio2368 28413fd626 Change log library to spdlog, expose log levels to user (#72)
* Change from glog to spdlog

* Remove HA tests

* Remove logrotate log configuration

* Define custom main for unit gtests
2021-01-21 16:30:55 +01:00

15 lines
294 B
C++

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "utils/on_scope_exit.hpp"
TEST(OnScopeExit, BasicUsage) {
int variable = 1;
{
ASSERT_EQ(variable, 1);
utils::OnScopeExit on_exit([&variable] { variable = 2; });
EXPECT_EQ(variable, 1);
}
EXPECT_EQ(variable, 2);
}