summaryrefslogtreecommitdiff
path: root/tests/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-07 00:25:02 +0800
committerruki <[email protected]>2025-10-06 20:49:26 +0800
commitdc3f8642301976871a1510b2bda77b94b2984cac (patch)
treef938f75a25abb8b7c9a213a8efd8fa93dd19f82f /tests/modules
parentf51cf155e87c6302ebf2368f689d358626142ac9 (diff)
update hash test
Diffstat (limited to 'tests/modules')
-rw-r--r--tests/modules/hash/test.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/modules/hash/test.lua b/tests/modules/hash/test.lua
index 0d40265d2..6bfe89fcd 100644
--- a/tests/modules/hash/test.lua
+++ b/tests/modules/hash/test.lua
@@ -2,26 +2,29 @@ function test_rand32(t)
local set = {}
for i = 1, 1000000 do
local r = hash.rand32()
+ if set[r] then
+ print("i: %d, r: %s, o: %s", i, r, set[r])
+ end
t:require(set[r] == nil)
- set[r] = true
+ set[r] = r
end
end
function test_rand64(t)
local set = {}
- for i = 1, 1000000 do
+ for i = 1, 100000 do
local r = hash.rand64()
t:require(set[r] == nil)
- set[r] = true
+ set[r] = r
end
end
function test_rand128(t)
local set = {}
- for i = 1, 1000000 do
+ for i = 1, 100000 do
local r = hash.rand128()
t:require(set[r] == nil)
- set[r] = true
+ set[r] = r
end
end