summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-02-27 02:29:57 +0900
committerKoichi Sasada <ko1@atdot.net>2020-02-27 02:29:57 +0900
commit7c1553e91db07fed4fed3287b50304f1c69a685d (patch)
treece4e64d552d3186c72bb5db57bf37cc545d847e1 /tool
parent116c6320956ce80efcb1db849a190ebd7f8c8ad3 (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')
-rw-r--r--tool/lib/minitest/unit.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/tool/lib/minitest/unit.rb b/tool/lib/minitest/unit.rb
index 8569b2c495..d739a608f4 100644
--- a/tool/lib/minitest/unit.rb
+++ b/tool/lib/minitest/unit.rb
@@ -1297,6 +1297,9 @@ module MiniTest
start_time = Time.now
result = ""
+
+ srand @options[:seed]
+
begin
@passed = nil
self.before_setup