Skip to content
Myr

Add failing test for out-of-range '@' Unix timestamp

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Demonstrates that a '@'-timestamp large enough to overflow SystemTime panics ('overflow when adding duration to instant') instead of being rejected like other unparseable time inputs. See #2081.

authored by Nikolaus Schuetz · committed by Nikolaus Schuetz · parent 41532d1 · Browse files · 1 file+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−0 removed

  • other:+8 added−0 removed

1 file+8 added−0 removed

modified:src/filter/time.rs+8 added
197 unmodified lines
198 .unwrap()199 .applies_to(&t1s_later)200 );201 }202203 #[test]204 fn out_of_range_unix_timestamp_is_rejected() {205 // A '@' timestamp large enough to overflow SystemTime must return206 // None rather than panicking.207 assert!(TimeFilter::before(&format!("@{}", u64::MAX)).is_none());208 assert!(TimeFilter::after(&format!("@{}", u64::MAX)).is_none());209 }210}