diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-10 07:47:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-10 07:47:43 +0000 |
commit | 25aeeca5b7dbe470c5ee04a3802de0cb7f14b9ad (patch) | |
tree | 254f36f65d30a91bca0b675ce87ea5277dd462e9 /test/ripper/test_files.rb | |
parent | 5564a498e188a46d2fab5b26380c9a4b73c29ec2 (diff) | |
download | ruby-25aeeca5b7dbe470c5ee04a3802de0cb7f14b9ad.tar.gz |
test_files.rb: sample size
* test/ripper/test_files.rb (assert_parse_files): extract at least
one sample.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_files.rb')
-rw-r--r-- | test/ripper/test_files.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ripper/test_files.rb b/test/ripper/test_files.rb index 447519d5b4..ac24727e9b 100644 --- a/test/ripper/test_files.rb +++ b/test/ripper/test_files.rb @@ -35,7 +35,9 @@ class TestRipper::Generic < Test::Unit::TestCase end dir = ARGV.shift scripts = Dir.chdir(dir) {Dir[pattern]} - scripts = scripts.sample(scripts.size * TEST_RATIO) if TEST_RATIO < 1.0 + if (1...scripts.size).include?(num = scripts.size * TEST_RATIO) + scripts = scripts.sample(num) + end scripts.sort! for script in scripts assert_nothing_raised { |