From 99af8dfbc094ea1e8ef17ad6f5158a5b7ce727b4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 12 Sep 2017 18:14:59 +0200 Subject: Add test to subtract 12 months from a moment --- src/timetype.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/timetype.rs b/src/timetype.rs index 39fc997..59d6e9c 100644 --- a/src/timetype.rs +++ b/src/timetype.rs @@ -1887,6 +1887,13 @@ mod moment_plus_amount_tests { expected = NaiveDate::from_ymd(1999, 12, 31).and_hms(23, 59, 59); } + generate_test_moment_minus_amount! { + name = test_moment_minus_months; + base = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 0); + amount = TT::months(12); + expected = NaiveDate::from_ymd(1999, 1, 1).and_hms(0, 0, 0); + } + } #[cfg(test)] -- cgit v1.2.3