From 0b5d0ebecd71ecdeec6f17962648bfba94af883c Mon Sep 17 00:00:00 2001 From: Daniel Bauer Date: Sat, 17 Jul 2021 13:31:36 +0200 Subject: [PATCH] test time boundaries --- src/io.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/io.rs b/src/io.rs index 2b8188e..226dcdb 100644 --- a/src/io.rs +++ b/src/io.rs @@ -352,4 +352,16 @@ mod tests { let relative3 = super::get_relative_path(&path1, &path3); assert_eq!("path/to/subfolder/another_file.dat" ,relative3); } + + #[test] + fn is_in_time_boundaries() { + let mut cfg = cfg(); + cfg.start = 10.0; + cfg.end = 20.0; + assert!(super::is_in_time_boundaries(15.0, &cfg)); + assert!(super::is_in_time_boundaries(10.0, &cfg)); + assert!(super::is_in_time_boundaries(20.0, &cfg)); + assert!(!super::is_in_time_boundaries(9.9999999, &cfg)); + assert!(!super::is_in_time_boundaries(20.000001, &cfg)); + } } \ No newline at end of file