aboutsummaryrefslogtreecommitdiff
path: root/src/test/rpc_tests.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-10-23 02:13:18 -0700
committerGavin Andresen <[email protected]>2013-10-23 02:13:18 -0700
commit9bd5b0be53630787559f32bfbcee0018a3734080 (patch)
tree365199f0c76a1ab36028d797410ba4e319466b1a /src/test/rpc_tests.cpp
parentMerge pull request #3129 from Diapolo/rem-dup-helpmsg (diff)
parentAdd test for monetary value formatting (diff)
downloaddiscoin-9bd5b0be53630787559f32bfbcee0018a3734080.tar.xz
discoin-9bd5b0be53630787559f32bfbcee0018a3734080.zip
Merge pull request #3133 from laanwj/2013_10_format_monetary_test
Add test for monetary value formatting
Diffstat (limited to 'src/test/rpc_tests.cpp')
-rw-r--r--src/test/rpc_tests.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp
index 35eabed0e..b771c0c4b 100644
--- a/src/test/rpc_tests.cpp
+++ b/src/test/rpc_tests.cpp
@@ -168,4 +168,14 @@ BOOST_AUTO_TEST_CASE(rpc_rawsign)
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()