Merge pull request #31 from Benjscho/main

Add test for parsing epoch seconds
This commit is contained in:
Sylvestre Ledru
2023-08-21 07:10:15 +02:00
committed by GitHub
+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)]