Skip to content

Commit

Permalink
tests: unit test time interval contains
Browse files Browse the repository at this point in the history
  • Loading branch information
hanadi92 committed May 9, 2024
1 parent d599a61 commit f74b965
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rust/src/push/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,10 @@ fn test_custom_action() {
#[test]
fn test_time_interval_contains() {
let interval = TimeInterval::new("08:00", "12:00");
let time = "08:00".parse::<NaiveTime>().unwrap();
let does_it = interval.contains(time);

println!("{}", does_it)
let contains = interval.contains("09:00".parse::<NaiveTime>().unwrap());
assert!(contains);

let not_contains = interval.contains("20:00".parse::<NaiveTime>().unwrap());
assert!(!not_contains);
}

0 comments on commit f74b965

Please sign in to comment.