Fix tests for checked_duration_since

This commit is contained in:
Vitaly _Vi Shukela 2019-02-13 13:17:33 +03:00
parent 7b2a08cf49
commit d15c358000
No known key found for this signature in database
GPG Key ID: C097221D6E03DF68

View File

@ -224,6 +224,7 @@ pub fn duration_since(&self, earlier: Instant) -> Duration {
/// # Examples
///
/// ```no_run
/// #![feature(checked_duration_since)]
/// use std::time::{Duration, Instant};
/// use std::thread::sleep;
///
@ -653,7 +654,8 @@ fn instant_duration_panic() {
#[test]
fn checked_instant_duration_nopanic() {
let a = Instant::now();
(a - Duration::new(1, 0)).checked_duration_since(a);
let ret = (a - Duration::new(1, 0)).checked_duration_since(a);
assert_eq!(ret, None);
}
#[test]