mirror of
https://github.com/vlang/v.git
synced 2025-09-20 10:24:21 -04:00
time: reduce chances of failures on the CI, by time_test.c.v; make the failure diagnostic easier
This commit is contained in:
parent
c58563ce5a
commit
8e29ff7214
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user