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:
Delyan Angelov 2025-02-12 15:17:51 +02:00
parent d1524fee76
commit e3d8cdc357
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -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]
}
}