We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 294edaf commit c3b178fCopy full SHA for c3b178f
aw-transform/src/period_union.rs
@@ -92,4 +92,21 @@ mod tests {
92
assert_eq!(e_result[0].timestamp, dt);
93
assert_eq!(e_result[0].duration, Duration::milliseconds(2000));
94
}
95
+
96
+ /// Make sure nothing gets done when nothing to union (gaps present)
97
+ #[test]
98
+ fn test_period_union_nop() {
99
+ let e1 = Event {
100
+ id: None,
101
+ timestamp: DateTime::from_str("2000-01-01T00:00:01Z").unwrap(),
102
+ duration: Duration::seconds(1),
103
+ data: json_map! {"test": json!(1)},
104
+ };
105
106
+ let mut e2 = e1.clone();
107
+ e2.timestamp = DateTime::from_str("2000-01-01T00:00:03Z").unwrap();
108
109
+ let e_result = period_union(&[e1], &[e2]);
110
+ assert_eq!(e_result.len(), 2);
111
+ }
112
0 commit comments