From db8a62d4802a005b80aa07ca355ddee4bf098b11 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 22 Sep 2022 21:15:27 +0800 Subject: fixes #20285; prevent oid time overflow at year 2038 (#20338) * Revert "fixes #20285; prevent oid time overflow at year 2038" This reverts commit dfcdb6ec2ab6a5fa53b6a99294a84fd122be8f8d. * increase time to 64 bits and clean up * add testcase * inline consts * add a changelog * fixes #20285; prevent oid time overflow at year 2038 --- tests/stdlib/toids.nim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/stdlib/toids.nim b/tests/stdlib/toids.nim index f162dbe57..72900d1ef 100644 --- a/tests/stdlib/toids.nim +++ b/tests/stdlib/toids.nim @@ -1,6 +1,15 @@ +discard """ + matrix: "--mm:refc; --mm:orc" +""" + import std/oids block: # genOid let x = genOid() - doAssert ($x).len == 24 + doAssert ($x).len == 32 + +block: + let x = genOid() + let y = parseOid(cstring($x)) + doAssert x == y -- cgit 1.4.1-2-gfad0