mirror of
https://github.com/vlang/v.git
synced 2025-08-03 17:57:59 -04: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
@ -15,9 +15,9 @@ fn test_tm_gmtoff() {
|
|||||||
dump(t2)
|
dump(t2)
|
||||||
dump(t1.nanosecond)
|
dump(t1.nanosecond)
|
||||||
dump(t2.nanosecond)
|
dump(t2.nanosecond)
|
||||||
diff := t1.unix() - t2.unix()
|
diff := int(t1.unix() - t2.unix())
|
||||||
dump(diff)
|
dump(diff)
|
||||||
dump(info.tm_gmtoff)
|
dump(info.tm_gmtoff)
|
||||||
assert info.tm_gmtoff == diff
|
assert diff in [info.tm_gmtoff - 1, info.tm_gmtoff, info.tm_gmtoff + 1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user