about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-11-19 16:20:13 +0800
committerkennytm <kennytm@gmail.com>2018-11-19 22:06:45 +0800
commit8cea658b907dd929e99514dae4c8d29f047153dc (patch)
tree34da3fc3d98516b792254200a7281b60e0ad8d6d /src/libstd
parent10565c45acd85cd73c4554887863fe3a0176e2c1 (diff)
parent86073253d563a7792765933f24acbf93fd3fee1d (diff)
downloadrust-8cea658b907dd929e99514dae4c8d29f047153dc.tar.gz
rust-8cea658b907dd929e99514dae4c8d29f047153dc.zip
Rollup merge of #56059 - alexcrichton:fix-tests, r=sfackler
Increase `Duration` approximate equal threshold to 1us

Previously this threshold when testing was 100ns, but the Windows
documentation states:

> which is a high resolution (<1us) time stamp

which presumably means that we could have up to 1us resolution, which
means that 100ns doesn't capture "equivalent" time intervals due to
various bits of rounding here and there.

It's hoped that this..

Closes #56034
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/time.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/time.rs b/src/libstd/time.rs
index d124cf53dda..58be1972a81 100644
--- a/src/libstd/time.rs
+++ b/src/libstd/time.rs
@@ -481,7 +481,7 @@ mod tests {
             let (a, b) = ($a, $b);
             if a != b {
                 let (a, b) = if a > b {(a, b)} else {(b, a)};
-                assert!(a - Duration::new(0, 100) <= b,
+                assert!(a - Duration::new(0, 1000) <= b,
                         "{:?} is not almost equal to {:?}", a, b);
             }
         })