mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
std: Add debugging for a failing test on appveyor
I'm not sure why this is failing, so let's hopefully get some more information to help investigation!
This commit is contained in:
+5
-1
@@ -481,7 +481,8 @@ 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, 100) <= b);
|
||||
assert!(a - Duration::new(0, 100) <= b,
|
||||
"{:?} is not almost equal to {:?}", a, b);
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -503,7 +504,10 @@ fn instant_elapsed() {
|
||||
fn instant_math() {
|
||||
let a = Instant::now();
|
||||
let b = Instant::now();
|
||||
println!("a: {:?}", a);
|
||||
println!("b: {:?}", b);
|
||||
let dur = b.duration_since(a);
|
||||
println!("dur: {:?}", dur);
|
||||
assert_almost_eq!(b - dur, a);
|
||||
assert_almost_eq!(a + dur, b);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user