Skip to content

Commit

Permalink
time: improve the robustness of time_test.c.v (check if the diff is w…
Browse files Browse the repository at this point in the history
…ithin ±1 second of the current timezone difference)
  • Loading branch information
spytheman committed Feb 12, 2025
1 parent d1524fe commit e3d8cdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/time/time_test.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ fn test_tm_gmtoff() {
dump(t2)
dump(t1.nanosecond)
dump(t2.nanosecond)
diff := t1.unix() - t2.unix()
diff := int(t1.unix() - t2.unix())
dump(diff)
dump(info.tm_gmtoff)
assert info.tm_gmtoff == diff
assert diff in [info.tm_gmtoff - 1, info.tm_gmtoff, info.tm_gmtoff + 1]
}
}

0 comments on commit e3d8cdc

Please sign in to comment.