local math = require("@neyuki/math")
for i in {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} do
local value = math.random(1, 10)
assert(value >= 1 and value <= 10, "random value is outside the requested range")
end
local largeMin = 0x1_0000_0000_0000_0000
local largeMax = largeMin + 10
local largeValue = math.random(largeMin, largeMax)
assert(typeof(largeValue) == "bigint", "bigint random should return a bigint")
assert(largeValue >= largeMin and largeValue <= largeMax, "bigint random value is outside the requested range")
local ok, err = try(math.random, 10, 1)
assert(not ok, "random should reject an inverted range")
print("[pass] randomization")