diff options
author | Kim Alvefur <zash@zash.se> | 2016-02-22 15:24:20 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-02-22 15:24:20 +0100 |
commit | 82a913c6816be2b0503368afac85b8b20335db0e (patch) | |
tree | 3bb6d5bb05f75122414728e4605bbdb9aacacae0 /tests | |
parent | 2675b63e1b14a929277d2ad8bcf6f1ec17187de2 (diff) | |
parent | a1bba9eeab3263061a2b1e1634847b3ed4002e20 (diff) | |
download | prosody-82a913c6816be2b0503368afac85b8b20335db0e.tar.gz prosody-82a913c6816be2b0503368afac85b8b20335db0e.zip |
Merge 0.10->trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.lua | 1 | ||||
-rw-r--r-- | tests/test_util_random.lua | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua index 4863c4e7..0fcc4907 100644 --- a/tests/test.lua +++ b/tests/test.lua @@ -23,6 +23,7 @@ function run_all_tests() dotest "util.cache" dotest "util.throttle" dotest "util.uuid" + dotest "util.random" dosingletest("test_sasl.lua", "latin1toutf8"); dosingletest("test_utf8.lua", "valid"); diff --git a/tests/test_util_random.lua b/tests/test_util_random.lua new file mode 100644 index 00000000..79572ef8 --- /dev/null +++ b/tests/test_util_random.lua @@ -0,0 +1,10 @@ +-- 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 |