Add test for parsing epoch seconds

Add test to verify epoch seconds can be parsed by `parse_datetime`.
This commit is contained in:
Ben Schofield
2023-08-20 18:41:39 -07:00
parent 497bebb9e7
commit a35530ed4a
+8
View File
@@ -190,6 +190,14 @@ mod tests {
assert_eq!(from_str(dt), Err(ParseDurationError::InvalidInput));
}
}
#[test]
fn test_epoch_seconds() {
env::set_var("TZ", "UTC");
let dt = "@1613371067";
let actual = from_str(dt);
assert_eq!(actual.unwrap().timestamp(), TEST_TIME);
}
}
#[cfg(test)]