Skip to content

Commit c3b178f

Browse files
committed
test: added nop test for period_union
1 parent 294edaf commit c3b178f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

aw-transform/src/period_union.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,21 @@ mod tests {
9292
assert_eq!(e_result[0].timestamp, dt);
9393
assert_eq!(e_result[0].duration, Duration::milliseconds(2000));
9494
}
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+
}
95112
}

0 commit comments

Comments
 (0)