aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-19 13:31:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-19 13:31:53 -0300
commit2f22c6bb79d209a55b3fc8e0b2d9c9f89f038174 (patch)
tree9fcece0aa1fa65f52b547c51e3c39181815f0887 /testes
parent3c0d3c6fbeea18f257102c62a01b036c7a5c5161 (diff)
downloadlua-2f22c6bb79d209a55b3fc8e0b2d9c9f89f038174.tar.gz
lua-2f22c6bb79d209a55b3fc8e0b2d9c9f89f038174.tar.bz2
lua-2f22c6bb79d209a55b3fc8e0b2d9c9f89f038174.zip
'math.randomseed' always returns the two seed components
Diffstat (limited to 'testes')
-rw-r--r--testes/math.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/testes/math.lua b/testes/math.lua
index 0c297e74..d0aaa6a5 100644
--- a/testes/math.lua
+++ b/testes/math.lua
@@ -842,9 +842,11 @@ end
842 842
843do 843do
844 -- testing return of 'randomseed' 844 -- testing return of 'randomseed'
845 local <const> x, <const> y = math.randomseed() 845 local x, y = math.randomseed()
846 local res = math.random(0) 846 local res = math.random(0)
847 math.randomseed(x, y) -- should repeat the state 847 x, y = math.randomseed(x, y) -- should repeat the state
848 assert(math.random(0) == res)
849 math.randomseed(x, y) -- again should repeat the state
848 assert(math.random(0) == res) 850 assert(math.random(0) == res)
849 -- keep the random seed for following tests 851 -- keep the random seed for following tests
850end 852end