Skip to content

Commit

Permalink
time: reduce chances of failures on the CI, by time_test.c.v; make th…
Browse files Browse the repository at this point in the history
…e failure diagnostic easier
  • Loading branch information
spytheman committed Feb 12, 2025
1 parent c58563c commit 8e29ff7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vlib/time/time_test.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 8e29ff7

Please sign in to comment.