diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-11-11 03:41:00 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-11-11 03:41:00 +0100 |
commit | f707177fd0897a701c907ec4b0a036982a9a7995 (patch) | |
tree | 245832deb230556821deb19cf1844fdcdbb0822d | |
parent | 6e95f67718513c81ab277931fe2c5d3b775020e4 (diff) | |
parent | 0c33cb7ac61ba3764d80a0b7f5be356dcc2e1630 (diff) |
Merge branch 'minor'
-rw-r--r-- | src/timetype.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/timetype.rs b/src/timetype.rs index 019b5ff..8d17abd 100644 --- a/src/timetype.rs +++ b/src/timetype.rs @@ -2271,6 +2271,27 @@ mod moment_plus_amount_tests { amount = TT::months(78); expected = NaiveDate::from_ymd(2006, 7, 1).and_hms(0, 0, 0); } + + generate_test_moment_plus_amount! { + name = test_moment_plus_more_than_one_year_in_months_4; + base = NaiveDate::from_ymd(2000,10,31).and_hms(0, 0, 0); + amount = TT::months(4); + expected = NaiveDate::from_ymd(2001, 3, 1).and_hms(0, 0, 0); + } + + generate_test_moment_plus_amount! { + name = test_moment_plus_more_than_one_year_in_months_5; + base = NaiveDate::from_ymd(2000,10,31).and_hms(0, 0, 0); + amount = TT::months(5); + expected = NaiveDate::from_ymd(2001, 4, 1).and_hms(0, 0, 0); + } + + generate_test_moment_plus_amount! { + name = test_moment_plus_more_than_one_year_in_months_6; + base = NaiveDate::from_ymd(2000,10,31).and_hms(0, 0, 0); + amount = TT::months(4) + TT::months(1); + expected = NaiveDate::from_ymd(2001, 4, 1).and_hms(0, 0, 0); + } } #[cfg(test)] |