mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Improve test output for libcore/time
This commit is contained in:
parent
e9e5a75fd2
commit
e9ee2cbc53
@ -2,7 +2,7 @@ use core::time::Duration;
|
||||
|
||||
#[test]
|
||||
fn creation() {
|
||||
assert!(Duration::from_secs(1) != Duration::from_secs(0));
|
||||
assert_ne!(Duration::from_secs(1), Duration::from_secs(0));
|
||||
assert_eq!(Duration::from_secs(1) + Duration::from_secs(2),
|
||||
Duration::from_secs(3));
|
||||
assert_eq!(Duration::from_millis(10) + Duration::from_secs(4),
|
||||
@ -107,14 +107,12 @@ fn checked_sub() {
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
#[cfg(not(miri))] // Miri does not support panics
|
||||
fn sub_bad1() {
|
||||
let _ = Duration::new(0, 0) - Duration::new(0, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
#[cfg(not(miri))] // Miri does not support panics
|
||||
fn sub_bad2() {
|
||||
let _ = Duration::new(0, 0) - Duration::new(1, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user