diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/tests/time.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/tests/time.rs b/src/libcore/tests/time.rs index 273f1258bb0..c1fbdf7df76 100644 --- a/src/libcore/tests/time.rs +++ b/src/libcore/tests/time.rs @@ -12,6 +12,12 @@ fn creation() { } #[test] +#[should_panic] +fn new_overflow() { + let _ = Duration::new(::core::u64::MAX, 1_000_000_000); +} + +#[test] fn secs() { assert_eq!(Duration::new(0, 0).as_secs(), 0); assert_eq!(Duration::new(0, 500_000_005).as_secs(), 0); |
