summaryrefslogtreecommitdiff
path: root/tests/modules/hash/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modules/hash/test.lua')
-rw-r--r--tests/modules/hash/test.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/modules/hash/test.lua b/tests/modules/hash/test.lua
new file mode 100644
index 000000000..0d40265d2
--- /dev/null
+++ b/tests/modules/hash/test.lua
@@ -0,0 +1,27 @@
+function test_rand32(t)
+ local set = {}
+ for i = 1, 1000000 do
+ local r = hash.rand32()
+ t:require(set[r] == nil)
+ set[r] = true
+ end
+end
+
+function test_rand64(t)
+ local set = {}
+ for i = 1, 1000000 do
+ local r = hash.rand64()
+ t:require(set[r] == nil)
+ set[r] = true
+ end
+end
+
+function test_rand128(t)
+ local set = {}
+ for i = 1, 1000000 do
+ local r = hash.rand128()
+ t:require(set[r] == nil)
+ set[r] = true
+ end
+end
+