From 2f22c6bb79d209a55b3fc8e0b2d9c9f89f038174 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 19 Jul 2019 13:31:53 -0300 Subject: 'math.randomseed' always returns the two seed components --- testes/math.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'testes') 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 do -- testing return of 'randomseed' - local x, y = math.randomseed() + local x, y = math.randomseed() local res = math.random(0) - math.randomseed(x, y) -- should repeat the state + x, y = math.randomseed(x, y) -- should repeat the state + assert(math.random(0) == res) + math.randomseed(x, y) -- again should repeat the state assert(math.random(0) == res) -- keep the random seed for following tests end -- cgit v1.2.3-55-g6feb