summaryrefslogtreecommitdiffstats
path: root/src/timetype.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-09-09 13:30:59 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-09-12 18:06:48 +0200
commit80c4596fca3cd952a5e55e67db1b70230a7efdba (patch)
tree64628f67c1afdd3e4f5f72098b804b3145a94fa1 /src/timetype.rs
parentb0b7986cb5fce14c70fb60ae3bdf29f19953e68f (diff)
Add more tests
Diffstat (limited to 'src/timetype.rs')
-rw-r--r--src/timetype.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/timetype.rs b/src/timetype.rs
index 46f5cb6..0c7f006 100644
--- a/src/timetype.rs
+++ b/src/timetype.rs
@@ -1342,5 +1342,33 @@ mod moment_plus_amount_tests {
expected = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 0);
}
+ generate_test_moment_plus_amount! {
+ name = test_moment_plus_seconds;
+ base = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 0);
+ amount = TT::seconds(1);
+ expected = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 1);
+ }
+
+ generate_test_moment_plus_amount! {
+ name = test_moment_plus_minutes;
+ base = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 0);
+ amount = TT::minutes(2);
+ expected = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 2, 0);
+ }
+
+ generate_test_moment_plus_amount! {
+ name = test_moment_plus_minutes_in_seconds;
+ base = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 0);
+ amount = TT::seconds(62);
+ expected = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 1, 2);
+ }
+
+ generate_test_moment_plus_amount! {
+ name = test_moment_plus_years;
+ base = NaiveDate::from_ymd(2000, 1, 1).and_hms(0, 0, 0);
+ amount = TT::years(62);
+ expected = NaiveDate::from_ymd(2062, 1, 1).and_hms(0, 0, 0);
+ }
+
}