ruby-changes:44618
From: nobu <ko1@a...>
Date: Thu, 10 Nov 2016 16:47:47 +0900 (JST)
Subject: [ruby-changes:44618] nobu:r56691 (trunk): test_files.rb: sample size
nobu 2016-11-10 16:47:43 +0900 (Thu, 10 Nov 2016) New Revision: 56691 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56691 Log: test_files.rb: sample size * test/ripper/test_files.rb (assert_parse_files): extract at least one sample. Modified files: trunk/test/ripper/test_files.rb Index: test/ripper/test_files.rb =================================================================== --- test/ripper/test_files.rb (revision 56690) +++ test/ripper/test_files.rb (revision 56691) @@ -35,7 +35,9 @@ class TestRipper::Generic < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/test/ripper/test_files.rb#L35 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 { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/