projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
tests: Add minimal test for util.random that checks that it returns the number of...
[prosody.git]
/
tests
/
test_util_random.lua
diff --git a/tests/test_util_random.lua
b/tests/test_util_random.lua
new file mode 100644
(file)
index 0000000..
79572ef
--- /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