time: reduce chances of failures on the CI, by time_test.c.v; make the failure diagnostic easier

This commit is contained in:
Delyan Angelov 2025-02-12 14:53:41 +02:00
parent c58563ce5a
commit 8e29ff7214
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -9,6 +9,15 @@ fn test_tm_gmtoff() {
C.time(&rawtime) // C.tm{}
info := C.localtime(&rawtime)
assert info.tm_gmtoff == time.now().unix() - time.utc().unix()
t1 := time.now()
t2 := time.utc()
dump(t1)
dump(t2)
dump(t1.nanosecond)
dump(t2.nanosecond)
diff := t1.unix() - t2.unix()
dump(diff)
dump(info.tm_gmtoff)
assert info.tm_gmtoff == diff
}
}