Skip to content

Commit 5dbc373

Browse files
committed
Fix tests for SystemTime addition on mac and ios
Those platforms don't support nanosecond precision, so adding 1 nanosecond does nothing.
1 parent a59cd36 commit 5dbc373

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/time/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ mod tests {
305305
assert_almost_eq!(a - (eighty_years * 10) + (eighty_years * 10), a);
306306

307307
let one_second_from_epoch = UNIX_EPOCH + Duration::new(1, 0);
308-
let one_second_from_epoch2 = UNIX_EPOCH + Duration::new(0, 999_999_999)
309-
+ Duration::new(0, 1);
308+
let one_second_from_epoch2 = UNIX_EPOCH + Duration::new(0, 500_000_000)
309+
+ Duration::new(0, 500_000_000);
310310
assert_eq!(one_second_from_epoch, one_second_from_epoch2);
311311
}
312312

0 commit comments

Comments
 (0)