aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_util_random.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-02-22 15:24:20 +0100
committerKim Alvefur <zash@zash.se>2016-02-22 15:24:20 +0100
commitcccb4ab09be9573c02e0d2684e062363cd7eb068 (patch)
tree3bb6d5bb05f75122414728e4605bbdb9aacacae0 /tests/test_util_random.lua
parente13dc52b494737b8fa8e9c14ce68810782bee7aa (diff)
parent7ebc652e1dde5db4ba00782579a1948b912fa930 (diff)
downloadprosody-cccb4ab09be9573c02e0d2684e062363cd7eb068.tar.gz
prosody-cccb4ab09be9573c02e0d2684e062363cd7eb068.zip
Merge 0.10->trunk
Diffstat (limited to 'tests/test_util_random.lua')
-rw-r--r--tests/test_util_random.lua10
1 files changed, 10 insertions, 0 deletions
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