summaryrefslogtreecommitdiff
path: root/tool/test
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-02-27 03:47:41 +0900
committerKoichi Sasada <ko1@atdot.net>2020-02-27 03:47:41 +0900
commit14f179080713012251e1faecccefebf2f33ecd86 (patch)
tree1e88fb58c3cf1cdf123c68febb875bceac6ac8c0 /tool/test
parentf9d314245b1b088555253f5b653a801031cdc1e6 (diff)
`srand($seed)` at the beginning of each test
To avoid `srand(0)` effect in the other tests, call `srand($seed)` at the beginning of each test (setup). [Feature #16655]
Diffstat (limited to 'tool/test')
-rw-r--r--tool/test/minitest/metametameta.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/test/minitest/metametameta.rb b/tool/test/minitest/metametameta.rb
index a12717c8b1..f7e0f02798 100644
--- a/tool/test/minitest/metametameta.rb
+++ b/tool/test/minitest/metametameta.rb
@@ -47,6 +47,7 @@ class MetaMetaMetaTestCase < MiniTest::Unit::TestCase
srand 42
MiniTest::Unit::TestCase.reset
@tu = MiniTest::Unit.new
+ @tu.options[:seed] = 42
MiniTest::Unit.runner = nil # protect the outer runner from the inner tests
end