Software /
code /
prosody
File
tests/test_util_random.lua @ 8254:e3f7b6fa46ba
util.throttle: Fix initial time setting (double accounting the first time) and fractional balance updates (0.1*10 was not the same as 1*1)
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 17 Sep 2017 13:29:14 -0400 |
parent | 7172:32b74ad54432 |
line wrap: on
line source
-- Makes no attempt at testing how random the bytes are, -- just that it returns the number of bytes requested function bytes(bytes) assert_is(bytes(16)); for i = 1, 255 do assert_equal(i, #bytes(i)); end end