mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Add test for monetary value formatting
Tests for issue #3126. This problem pops up after upgrading json-spirit.
This commit is contained in:
parent
58daa0162c
commit
4538130790
@ -168,4 +168,14 @@ BOOST_AUTO_TEST_CASE(rpc_rawsign)
|
|||||||
BOOST_CHECK(find_value(r.get_obj(), "complete").get_bool() == true);
|
BOOST_CHECK(find_value(r.get_obj(), "complete").get_bool() == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(rpc_format_monetary_values)
|
||||||
|
{
|
||||||
|
BOOST_CHECK(write_string(Value(0.0), false) == "0.00000000");
|
||||||
|
BOOST_CHECK(write_string(Value(1.0), false) == "1.00000000");
|
||||||
|
BOOST_CHECK(write_string(Value(0.5), false) == "0.50000000");
|
||||||
|
BOOST_CHECK(write_string(Value(0.00000001), false) == "0.00000001");
|
||||||
|
BOOST_CHECK(write_string(Value(0.17622195), false) == "0.17622195");
|
||||||
|
BOOST_CHECK(write_string(Value(0.89898989), false) == "0.89898989");
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
Loading…
Reference in New Issue
Block a user