Skip to content

Commit

Permalink
Fix test failure in before-utc timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWildfong committed Jun 13, 2024
1 parent 9fc7e94 commit 3fdafe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_force_utc_4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ fn test_force_utc_4() {
s[12..27].parse::<NaiveTime>().unwrap(),
);

if now.offset().utc_minus_local() > 100 || now.offset().utc_minus_local() < -100 {
if now.offset().utc_minus_local().abs() > 100 {
// local TZ is different from UTC -> verify that UTC was written to the file
let now_local = now.naive_local();
let diff = (now_local - d).num_seconds();
println!("d: {d}, now_local: {now_local}, diff: {diff}");
assert!(diff >= 10);
assert!(diff.abs() >= 10);
}
}

0 comments on commit 3fdafe6

Please sign in to comment.