summary refs log tree commit diff stats
path: root/tests/stdlib/tsysrand.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tsysrand.nim')
-rw-r--r--tests/stdlib/tsysrand.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/stdlib/tsysrand.nim b/tests/stdlib/tsysrand.nim
new file mode 100644
index 000000000..d248849f8
--- /dev/null
+++ b/tests/stdlib/tsysrand.nim
@@ -0,0 +1,13 @@
+discard """
+  targets: "c cpp js"
+"""
+
+import std/sysrand
+
+
+doAssert urandom(0).len == 0
+doAssert urandom(10).len == 10
+doAssert urandom(20).len == 20
+doAssert urandom(120).len == 120
+doAssert urandom(113).len == 113
+doAssert urandom(1234) != urandom(1234) # unlikely to fail in practice