2
0
mirror of https://github.com/boostorg/redis.git synced 2026-01-19 04:42:09 +00:00

tests for boolean

This commit is contained in:
Ruben Perez
2025-04-07 11:30:28 +02:00
parent 8b98081ccf
commit f32da1b0e3

View File

@@ -66,3 +66,32 @@ BOOST_AUTO_TEST_CASE(ints)
BOOST_TEST(std::get<9>(resp).value() == 42);
BOOST_TEST(std::get<10>(resp).value() == 42);
}
BOOST_AUTO_TEST_CASE(bools)
{
// Setup
net::io_context ioc;
auto conn = std::make_shared<connection>(ioc);
run(conn);
// Get a boolean
request req;
req.push("SET", "key_true", "t");
req.push("SET", "key_false", "f");
req.push("GET", "key_true");
req.push("GET", "key_false");
response<ignore_t, ignore_t, bool, bool> resp;
conn->async_exec(req, resp, [conn](error_code ec, std::size_t) {
BOOST_TEST(!ec);
conn->cancel();
});
// Run the operations
ioc.run();
// Check
BOOST_TEST(std::get<2>(resp).value() == true);
BOOST_TEST(std::get<3>(resp).value() == false);
}