Skip to content

Commit 8e29ff7

Browse files
committed
time: reduce chances of failures on the CI, by time_test.c.v; make the failure diagnostic easier
1 parent c58563c commit 8e29ff7

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎vlib/time/time_test.c.v‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ fn test_tm_gmtoff() {
99
C.time(&rawtime) // C.tm{}
1010

1111
info := C.localtime(&rawtime)
12-
assert info.tm_gmtoff == time.now().unix() - time.utc().unix()
12+
t1 := time.now()
13+
t2 := time.utc()
14+
dump(t1)
15+
dump(t2)
16+
dump(t1.nanosecond)
17+
dump(t2.nanosecond)
18+
diff := t1.unix() - t2.unix()
19+
dump(diff)
20+
dump(info.tm_gmtoff)
21+
assert info.tm_gmtoff == diff
1322
}
1423
}

0 commit comments

Comments
 (0)