mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
time: improve the robustness of time_test.c.v (check if the diff is within ±1 second of the current timezone difference)
This commit is contained in:
parent
d1524fee76
commit
e3d8cdc357
1 changed files with 2 additions and 2 deletions
|
@ -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]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue