diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-02-27 02:29:57 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-02-27 02:29:57 +0900 |
commit | 7c1553e91db07fed4fed3287b50304f1c69a685d (patch) | |
tree | ce4e64d552d3186c72bb5db57bf37cc545d847e1 /tool/lib | |
parent | 116c6320956ce80efcb1db849a190ebd7f8c8ad3 (diff) | |
download | ruby-7c1553e91db07fed4fed3287b50304f1c69a685d.tar.gz |
`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/lib')
-rw-r--r-- | tool/lib/minitest/unit.rb | 3 |
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 |