From 5dbc373f708fb203a354f2b6b08009c28d694244 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Thu, 3 Dec 2015 08:27:32 -0700 Subject: [PATCH] Fix tests for SystemTime addition on mac and ios Those platforms don't support nanosecond precision, so adding 1 nanosecond does nothing. --- src/libstd/time/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index b7509cd3800..e3ce8e0de4b 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -305,8 +305,8 @@ mod tests { assert_almost_eq!(a - (eighty_years * 10) + (eighty_years * 10), a); let one_second_from_epoch = UNIX_EPOCH + Duration::new(1, 0); - let one_second_from_epoch2 = UNIX_EPOCH + Duration::new(0, 999_999_999) - + Duration::new(0, 1); + let one_second_from_epoch2 = UNIX_EPOCH + Duration::new(0, 500_000_000) + + Duration::new(0, 500_000_000); assert_eq!(one_second_from_epoch, one_second_from_epoch2); }