Skip to content

Commit

Permalink
Add test that also uses timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed May 27, 2024
1 parent 568ad78 commit fd5acd5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions client/src/schedule/mutation/starts_before.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,33 @@ mod test {
assert_eq!(mutated[0], events[0]);
assert_eq!(mutated[1], events[1]);
}

#[test]
fn across_timezones() {
let events = vec![
Event::dummy(
0,
DateTime::parse_from_rfc3339("2024-03-12T20:00:00+01:00").unwrap(),
),
Event::dummy(
1,
DateTime::parse_from_rfc3339("2024-03-12T21:00:00+01:00").unwrap(),
),
Event::dummy(
2,
DateTime::parse_from_rfc3339("2024-03-12T22:00:00+01:00").unwrap(),
),
];

let mutator =
StartsBefore::new(DateTime::parse_from_rfc3339("2024-03-12T20:59:59+00:00").unwrap());

let mut mutated = events.clone();
mutator.mutate(&mut mutated);

assert_eq!(mutated.len(), 2);

assert_eq!(mutated[0], events[0]);
assert_eq!(mutated[1], events[1]);
}
}

0 comments on commit fd5acd5

Please sign in to comment.