summaryrefslogtreecommitdiff
path: root/test/unit/t_amount.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/t_amount.cc')
-rw-r--r--test/unit/t_amount.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/t_amount.cc b/test/unit/t_amount.cc
index b82de510..28bc56e9 100644
--- a/test/unit/t_amount.cc
+++ b/test/unit/t_amount.cc
@@ -1163,6 +1163,18 @@ BOOST_AUTO_TEST_CASE(testCommodityCeiling)
BOOST_CHECK(x2.valid());
}
+BOOST_AUTO_TEST_CASE(testRound, * boost::unit_test::expected_failures(1))
+{
+ amount_t a1("$ 123.123");
+ amount_t a2(a1);
+ a2.in_place_roundto(2);
+ // Fails due to missing _dup() call in amount_t::in_place_roundto(int).
+ // <https://github.com/ledger/ledger/issues/2362>
+ BOOST_CHECK_EQUAL(amount_t("$ 123.123"), a1);
+ // Should it be "$ 123.12"?
+ BOOST_CHECK_EQUAL(amount_t("$ 123.120"), a2);
+}
+
#ifndef NOT_FOR_PYTHON
#if 0
BOOST_AUTO_TEST_CASE(testReduction)