Skip to content

Commit

Permalink
Auto merge of rust-lang#56017 - alexcrichton:debug-test, r=alexcrichton
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
bors committed Nov 18, 2018
2 parents d1c2cbf + 7a99b6d commit 13c9439
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libstd/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ 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, 100) <= b,
"{:?} is not almost equal to {:?}", a, b);
}
})
}
Expand All @@ -503,7 +504,10 @@ mod tests {
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);

Expand Down

0 comments on commit 13c9439

Please sign in to comment.