Skip to content

Commit 08d8a67

Browse files
committed
test months(Period)
1 parent c8c827b commit 08d8a67

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test-suite/period.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ BOOST_AUTO_TEST_CASE(testConvertToYears) {
154154
BOOST_TEST(years(Period(18, Months)) == 1.5, tol);
155155
}
156156

157+
BOOST_AUTO_TEST_CASE(testConvertToMonths) {
158+
BOOST_TEST_MESSAGE("Testing converting periods to months...");
159+
160+
BOOST_TEST(months(Period(0, Months)) == 0);
161+
BOOST_TEST(months(Period(1, Months)) == 1);
162+
BOOST_TEST(months(Period(5, Months)) == 5);
163+
164+
BOOST_TEST(months(Period(1, Years)) == 12);
165+
BOOST_TEST(months(Period(3, Years)) == 36);
166+
}
167+
157168
BOOST_AUTO_TEST_CASE(testNormalization) {
158169

159170
BOOST_TEST_MESSAGE("Testing period normalization...");

0 commit comments

Comments
 (0)