You've already forked parse_datetime
mirror of
https://github.com/uutils/parse_datetime.git
synced 2026-06-10 16:13:15 -07:00
Add test for parsing epoch seconds
Add test to verify epoch seconds can be parsed by `parse_datetime`.
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user