mirror of
https://github.com/chronotope/chrono.git
synced 2025-10-02 15:26:12 +00:00
Fix test_time_zone_from_posix_tz
in environments without a tzdb
This commit is contained in:
parent
0fce0d85d3
commit
ecfad9e108
@ -859,8 +859,12 @@ mod tests {
|
|||||||
assert_eq!(time_zone_local, time_zone_local_1);
|
assert_eq!(time_zone_local, time_zone_local_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let time_zone_utc = TimeZone::from_posix_tz("UTC")?;
|
// `TimeZone::from_posix_tz("UTC")` will return `Error` if the environment does not have
|
||||||
assert_eq!(time_zone_utc.find_local_time_type(0)?.offset(), 0);
|
// a time zone database, like for example some docker containers.
|
||||||
|
// In that case skip the test.
|
||||||
|
if let Ok(time_zone_utc) = TimeZone::from_posix_tz("UTC") {
|
||||||
|
assert_eq!(time_zone_utc.find_local_time_type(0)?.offset(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert!(TimeZone::from_posix_tz("EST5EDT,0/0,J365/25").is_err());
|
assert!(TimeZone::from_posix_tz("EST5EDT,0/0,J365/25").is_err());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user