aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/unittests/random.lua
diff options
context:
space:
mode:
Diffstat (limited to 'games/minimal/mods/unittests/random.lua')
-rw-r--r--games/minimal/mods/unittests/random.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/games/minimal/mods/unittests/random.lua b/games/minimal/mods/unittests/random.lua
new file mode 100644
index 000000000..f94f0a88e
--- /dev/null
+++ b/games/minimal/mods/unittests/random.lua
@@ -0,0 +1,10 @@
+function unittests.test_random()
+ -- Try out PseudoRandom
+ minetest.log("action", "[unittests] Testing PseudoRandom ...")
+ local pseudo = PseudoRandom(13)
+ assert(pseudo:next() == 22290)
+ assert(pseudo:next() == 13854)
+ minetest.log("action", "[unittests] PseudoRandom test passed!")
+ return true
+end
+