diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-02-27 03:47:41 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-02-27 03:47:41 +0900 |
commit | 14f179080713012251e1faecccefebf2f33ecd86 (patch) | |
tree | 1e88fb58c3cf1cdf123c68febb875bceac6ac8c0 /tool/lib/minitest/unit.rb | |
parent | f9d314245b1b088555253f5b653a801031cdc1e6 (diff) | |
download | ruby-14f179080713012251e1faecccefebf2f33ecd86.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/minitest/unit.rb')
-rw-r--r-- | tool/lib/minitest/unit.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tool/lib/minitest/unit.rb b/tool/lib/minitest/unit.rb index 8569b2c495..0b0d892436 100644 --- a/tool/lib/minitest/unit.rb +++ b/tool/lib/minitest/unit.rb @@ -1297,6 +1297,8 @@ module MiniTest start_time = Time.now result = "" + srand(runner.options[:seed]) + begin @passed = nil self.before_setup |