]> git.lizzy.rs Git - rust.git/commitdiff
std: Bump time margin in std::time tests
authorAlex Crichton <alex@alexcrichton.com>
Mon, 30 Nov 2015 18:53:20 +0000 (10:53 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 30 Nov 2015 18:53:20 +0000 (10:53 -0800)
I believe that because Windows' unit of resolution is 100ns that this unit of
time will ensure that the assertions will hold true as it's representable in the
native format.

cc #29970

src/libstd/time/mod.rs

index 261f3e266d7d1984dbc16d3249f30580b28bf094..d400d12e23f41e87ff71072a61ab54a6fce63a87 100644 (file)
@@ -235,7 +235,7 @@ macro_rules! assert_almost_eq {
             let (a, b) = ($a, $b);
             if a != b {
                 let (a, b) = if a > b {(a, b)} else {(b, a)};
-                assert!(a - Duration::new(0, 1) <= b);
+                assert!(a - Duration::new(0, 100) <= b);
             }
         })
     }