Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bschoenmaeckers committed Dec 17, 2024
1 parent cd21d02 commit 2de06e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tz/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,9 @@ impl TimeZone {
///
/// let tz = TimeZone::UTC;
/// // UTC is a fixed offset and so can be converted without a timestamp.
/// assert_eq!(tz.to_fixed_offset().unwrap(), Offset::UTC);
/// assert_eq!(tz.to_fixed_offset()?, Offset::UTC);
///
/// Ok::<(), Box<dyn std::error::Error>>(())
/// ```
#[inline]
pub fn to_fixed_offset(&self) -> Result<Offset, Error> {
Expand Down Expand Up @@ -3759,7 +3761,8 @@ mod tests {
let tz = TimeZone::posix("EST5").unwrap();
assert!(tz.to_fixed_offset().is_err());

let tz = TimeZone::get("America/New_York").unwrap();
let test_file = TzifTestFile::get("America/New_York");
let tz = TimeZone::tzif(test_file.name, test_file.data).unwrap();
assert!(tz.to_fixed_offset().is_err());
}
}

0 comments on commit 2de06e5

Please sign in to comment.