summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authortripun <tripun@gmail.com>2014-08-17 16:30:14 +0530
committertripun <tripun@gmail.com>2014-08-17 16:30:14 +0530
commit6c7a951a2da1e2aeb395930b573b1bc0f531efaa (patch)
tree7e6c359bc12122468a25c58bc601a1da4c4633a3 /test/unit
parent66478aa89416509c28ecf8a3886a232c2351cf48 (diff)
downloadfork-ledger-6c7a951a2da1e2aeb395930b573b1bc0f531efaa.tar.gz
fork-ledger-6c7a951a2da1e2aeb395930b573b1bc0f531efaa.tar.bz2
fork-ledger-6c7a951a2da1e2aeb395930b573b1bc0f531efaa.zip
add assignment unit test for value
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/t_value.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/unit/t_value.cc b/test/unit/t_value.cc
index 88d1f9fd..b6068652 100644
--- a/test/unit/t_value.cc
+++ b/test/unit/t_value.cc
@@ -68,5 +68,40 @@ BOOST_AUTO_TEST_CASE(testConstructors)
BOOST_CHECK(v15.valid());
}
+BOOST_AUTO_TEST_CASE(testAssignment)
+{
+ value_t v1;
+ value_t v2 = true;
+ value_t v3 = boost::posix_time::from_time_t(time_t(NULL));
+ value_t v4 = date_t(parse_date("2014/08/14"));
+ value_t v5 = -2L;
+ value_t v6 = 4UL;
+ value_t v7 = 1.00;
+ value_t v8 = amount_t("4 GBP");
+ value_t v9 = balance_t("3 EUR");
+ value_t v10 = mask_t("regex");
+ value_t v11 = new value_t::sequence_t();
+ value_t v12 = new value_t(string("$1"));
+ value_t v13 = new value_t("2 CAD");
+ value_t v14 = new value_t("comment",true);
+ value_t v15 = new value_t(string("tag"),true);
+
+ BOOST_CHECK(v1.valid());
+ BOOST_CHECK(v2.valid());
+ BOOST_CHECK(v3.valid());
+ BOOST_CHECK(v4.valid());
+ BOOST_CHECK(v5.valid());
+ BOOST_CHECK(v6.valid());
+ BOOST_CHECK(v7.valid());
+ BOOST_CHECK(v8.valid());
+ BOOST_CHECK(v9.valid());
+ BOOST_CHECK(v10.valid());
+ BOOST_CHECK(v11.valid());
+ BOOST_CHECK(v12.valid());
+ BOOST_CHECK(v13.valid());
+ BOOST_CHECK(v14.valid());
+ BOOST_CHECK(v15.valid());
+}
+
BOOST_AUTO_TEST_SUITE_END()