Skip to content

Commit c4e31e5

Browse files
committed
Floating point tests
1 parent f32da1b commit c4e31e5

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

test/test_conversions.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,30 @@ BOOST_AUTO_TEST_CASE(bools)
9494
// Check
9595
BOOST_TEST(std::get<2>(resp).value() == true);
9696
BOOST_TEST(std::get<3>(resp).value() == false);
97-
}
97+
}
98+
99+
BOOST_AUTO_TEST_CASE(floating_points)
100+
{
101+
// Setup
102+
net::io_context ioc;
103+
auto conn = std::make_shared<connection>(ioc);
104+
run(conn);
105+
106+
// Get a boolean
107+
request req;
108+
req.push("SET", "key", "4.12");
109+
req.push("GET", "key");
110+
111+
response<ignore_t, double> resp;
112+
113+
conn->async_exec(req, resp, [conn](error_code ec, std::size_t) {
114+
BOOST_TEST(!ec);
115+
conn->cancel();
116+
});
117+
118+
// Run the operations
119+
ioc.run();
120+
121+
// Check
122+
BOOST_TEST(std::get<1>(resp).value() == 4.12);
123+
}

0 commit comments

Comments
 (0)