From e3d8cdc357f4ba8a83d029a08ddea73b9b9ab3e7 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 12 Feb 2025 15:17:51 +0200 Subject: [PATCH] =?UTF-8?q?time:=20improve=20the=20robustness=20of=20time?= =?UTF-8?q?=5Ftest.c.v=20(check=20if=20the=20diff=20is=20within=20=C2=B11?= =?UTF-8?q?=20second=20of=20the=20current=20timezone=20difference)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vlib/time/time_test.c.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/time/time_test.c.v b/vlib/time/time_test.c.v index bf74593326..2222e1e2d6 100644 --- a/vlib/time/time_test.c.v +++ b/vlib/time/time_test.c.v @@ -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] } }