comparison spec/util_random_spec.lua @ 8450:3a9a3d90c44c

spec/util.random: Check a larger range of sizes
author Kim Alvefur <zash@zash.se>
date Sun, 03 Dec 2017 15:37:17 +0100
parents 4878e4159e12
children
comparison
equal deleted inserted replaced
8449:b572a708fd41 8450:3a9a3d90c44c
9 9
10 it("should return the requested number of bytes", function() 10 it("should return the requested number of bytes", function()
11 -- Makes no attempt at testing how random the bytes are, 11 -- Makes no attempt at testing how random the bytes are,
12 -- just that it returns the number of bytes requested 12 -- just that it returns the number of bytes requested
13 13
14 for i = 1, 255 do 14 for i = 1, 20 do
15 assert.are.equal(i, #random.bytes(i)); 15 assert.are.equal(2^i, #random.bytes(2^i));
16 end 16 end
17 end); 17 end);
18 end); 18 end);
19 end); 19 end);