ruby-changes:74159
From: nagachika <ko1@a...>
Date: Fri, 21 Oct 2022 14:02:47 +0900 (JST)
Subject: [ruby-changes:74159] 5d4bfaccab (ruby_3_1): merge revision(s) ab3cb29bd9bff9c16cfb9d19cc02026998282c12:
https://git.ruby-lang.org/ruby.git/commit/?id=5d4bfaccab From 5d4bfaccabe66d89460739ee682f1f78698c93a3 Mon Sep 17 00:00:00 2001 From: nagachika <nagachika@r...> Date: Fri, 21 Oct 2022 13:36:03 +0900 Subject: merge revision(s) ab3cb29bd9bff9c16cfb9d19cc02026998282c12: Avoid defining the same test class in multiple files Should fix issues with parallel testing sometimes not running all tests. This should be viewed skipping whitespace changes. Fixes [Bug #18731] --- test/-ext-/bignum/test_big2str.rb | 38 +- test/-ext-/bignum/test_bigzero.rb | 20 +- test/-ext-/bignum/test_div.rb | 38 +- test/-ext-/bignum/test_mul.rb | 260 ++++++------ test/-ext-/bignum/test_pack.rb | 653 +++++++++++++++---------------- test/-ext-/bignum/test_str2big.rb | 52 ++- test/-ext-/funcall/test_funcall.rb | 11 - test/-ext-/funcall/test_passing_block.rb | 5 + test/date/test_date_ractor.rb | 2 +- test/fileutils/clobber.rb | 5 +- test/fileutils/test_dryrun.rb | 2 +- test/fileutils/test_nowrite.rb | 2 +- test/fileutils/test_verbose.rb | 2 +- test/fileutils/visibility_tests.rb | 5 +- test/mkmf/base.rb | 225 ++++++----- test/mkmf/test_config.rb | 16 +- test/mkmf/test_constant.rb | 56 ++- test/mkmf/test_convertible.rb | 48 ++- test/mkmf/test_egrep_cpp.rb | 14 +- test/mkmf/test_find_executable.rb | 82 ++-- test/mkmf/test_flags.rb | 92 +++-- test/mkmf/test_framework.rb | 70 ++-- test/mkmf/test_have_func.rb | 18 +- test/mkmf/test_have_library.rb | 84 ++-- test/mkmf/test_have_macro.rb | 46 ++- test/mkmf/test_install.rb | 38 +- test/mkmf/test_libs.rb | 156 ++++---- test/mkmf/test_mkmf.rb | 14 +- test/mkmf/test_pkg_config.rb | 98 +++-- test/mkmf/test_signedness.rb | 38 +- test/mkmf/test_sizeof.rb | 74 ++-- test/optparse/test_acceptable.rb | 2 +- test/optparse/test_autoconf.rb | 4 +- test/optparse/test_bash_completion.rb | 4 +- test/optparse/test_cclass.rb | 2 +- test/optparse/test_did_you_mean.rb | 2 +- test/optparse/test_getopts.rb | 4 +- test/optparse/test_kwargs.rb | 4 +- test/optparse/test_noarg.rb | 6 +- test/optparse/test_optarg.rb | 2 +- test/optparse/test_placearg.rb | 2 +- test/optparse/test_reqarg.rb | 10 +- test/optparse/test_summary.rb | 2 +- test/optparse/test_zsh_completion.rb | 4 +- test/ruby/enc/test_emoji_breaks.rb | 207 +++++----- test/ruby/enc/test_grapheme_breaks.rb | 115 +++--- test/ruby/test_inlinecache.rb | 2 +- 47 files changed, 1280 insertions(+), 1356 deletions(-) delete mode 100644 test/-ext-/funcall/test_funcall.rb --- test/-ext-/bignum/test_big2str.rb | 38 +- test/-ext-/bignum/test_bigzero.rb | 20 +- test/-ext-/bignum/test_div.rb | 38 +- test/-ext-/bignum/test_mul.rb | 260 ++++++------ test/-ext-/bignum/test_pack.rb | 653 +++++++++++++++---------------- test/-ext-/bignum/test_str2big.rb | 52 ++- test/-ext-/funcall/test_funcall.rb | 11 - test/-ext-/funcall/test_passing_block.rb | 5 + test/date/test_date_ractor.rb | 2 +- test/fileutils/clobber.rb | 5 +- test/fileutils/test_dryrun.rb | 2 +- test/fileutils/test_nowrite.rb | 2 +- test/fileutils/test_verbose.rb | 2 +- test/fileutils/visibility_tests.rb | 5 +- test/mkmf/base.rb | 225 ++++++----- test/mkmf/test_config.rb | 16 +- test/mkmf/test_constant.rb | 56 ++- test/mkmf/test_convertible.rb | 48 ++- test/mkmf/test_egrep_cpp.rb | 14 +- test/mkmf/test_find_executable.rb | 82 ++-- test/mkmf/test_flags.rb | 92 +++-- test/mkmf/test_framework.rb | 70 ++-- test/mkmf/test_have_func.rb | 18 +- test/mkmf/test_have_library.rb | 84 ++-- test/mkmf/test_have_macro.rb | 46 ++- test/mkmf/test_install.rb | 38 +- test/mkmf/test_libs.rb | 156 ++++---- test/mkmf/test_mkmf.rb | 14 +- test/mkmf/test_pkg_config.rb | 98 +++-- test/mkmf/test_signedness.rb | 38 +- test/mkmf/test_sizeof.rb | 74 ++-- test/optparse/test_acceptable.rb | 2 +- test/optparse/test_autoconf.rb | 4 +- test/optparse/test_bash_completion.rb | 4 +- test/optparse/test_cclass.rb | 2 +- test/optparse/test_did_you_mean.rb | 2 +- test/optparse/test_getopts.rb | 4 +- test/optparse/test_kwargs.rb | 4 +- test/optparse/test_noarg.rb | 6 +- test/optparse/test_optarg.rb | 2 +- test/optparse/test_placearg.rb | 2 +- test/optparse/test_reqarg.rb | 10 +- test/optparse/test_summary.rb | 2 +- test/optparse/test_zsh_completion.rb | 4 +- test/ruby/enc/test_grapheme_breaks.rb | 115 +++--- test/ruby/test_inlinecache.rb | 2 +- version.h | 2 +- 47 files changed, 1179 insertions(+), 1252 deletions(-) delete mode 100644 test/-ext-/funcall/test_funcall.rb diff --git a/test/-ext-/bignum/test_big2str.rb b/test/-ext-/bignum/test_big2str.rb index f8d6320338..88e35a7294 100644 --- a/test/-ext-/bignum/test_big2str.rb +++ b/test/-ext-/bignum/test_big2str.rb @@ -2,29 +2,27 @@ https://github.com/ruby/ruby/blob/trunk/test/-ext-/bignum/test_big2str.rb#L2 require 'test/unit' require "-test-/bignum" -class Test_Bignum < Test::Unit::TestCase - class TestBig2str < Test::Unit::TestCase +class TestBignum_Big2str < Test::Unit::TestCase - SIZEOF_BDIGIT = Bug::Bignum::SIZEOF_BDIGIT - BITSPERDIG = Bug::Bignum::BITSPERDIG - BDIGMAX = (1 << BITSPERDIG) - 1 + SIZEOF_BDIGIT = Bug::Bignum::SIZEOF_BDIGIT + BITSPERDIG = Bug::Bignum::BITSPERDIG + BDIGMAX = (1 << BITSPERDIG) - 1 - def test_big2str_generic - x = 10**1000 - assert_equal("1" + "0" * 1000, Bug::Bignum.big2str_generic(x, 10)) - end - - def test_big2str_poweroftwo - e = BITSPERDIG*2 - x = 0b10**e - assert_equal("1" + "0" * e, Bug::Bignum.big2str_poweroftwo(x, 2)) - end + def test_big2str_generic + x = 10**1000 + assert_equal("1" + "0" * 1000, Bug::Bignum.big2str_generic(x, 10)) + end - def test_big2str_gmp - x = 10**1000 - assert_equal("1" + "0" * 1000, Bug::Bignum.big2str_gmp(x, 10)) - rescue NotImplementedError - end + def test_big2str_poweroftwo + e = BITSPERDIG*2 + x = 0b10**e + assert_equal("1" + "0" * e, Bug::Bignum.big2str_poweroftwo(x, 2)) + end + def test_big2str_gmp + x = 10**1000 + assert_equal("1" + "0" * 1000, Bug::Bignum.big2str_gmp(x, 10)) + rescue NotImplementedError end + end diff --git a/test/-ext-/bignum/test_bigzero.rb b/test/-ext-/bignum/test_bigzero.rb index cf34964acd..6dfa3486c1 100644 --- a/test/-ext-/bignum/test_bigzero.rb +++ b/test/-ext-/bignum/test_bigzero.rb @@ -2,19 +2,17 @@ https://github.com/ruby/ruby/blob/trunk/test/-ext-/bignum/test_bigzero.rb#L2 require 'test/unit' require "-test-/bignum" -class Test_Bignum < Test::Unit::TestCase - class TestBigZero < Test::Unit::TestCase - def test_equal_0 - bug8204 = '[ruby-core:53893] [Bug #8204]' - (0..10).each do |i| - assert_equal(0, Bug::Bignum.zero(i), "#{bug8204} Bignum.zero(#{i})") - end +class TestBignum_BigZero < Test::Unit::TestCase + def test_equal_0 + bug8204 = '[ruby-core:53893] [Bug #8204]' + (0..10).each do |i| + assert_equal(0, Bug::Bignum.zero(i), "#{bug8204} Bignum.zero(#{i})") end + end - def test_zero? - (0..10).each do |i| - assert_equal(true, Bug::Bignum.zero(i).zero?) - end + def test_zero? + (0..10).each do |i| + assert_equal(true, Bug::Bignum.zero(i).zero?) end end end diff --git a/test/-ext-/bignum/test_div.rb b/test/-ext-/bignum/test_div.rb index e61fc2ced5..0c6f635ae8 100644 --- a/test/-ext-/bignum/test_div.rb +++ b/test/-ext-/bignum/test_div.rb @@ -2,28 +2,26 @@ https://github.com/ruby/ruby/blob/trunk/test/-ext-/bignum/test_div.rb#L2 require 'test/unit' require "-test-/bignum" -class Test_Bignum < Test::Unit::TestCase - class TestDiv < Test::Unit::TestCase +class TestBignum_Div < Test::Unit::TestCase - SIZEOF_BDIGIT = Bug::Bignum::SIZEOF_BDIGIT - BITSPERDIG = Bug::Bignum::BITSPERDIG - BDIGMAX = (1 << BITSPERDIG) - 1 + SIZEOF_BDIGIT = Bug::Bignum::SIZEOF_BDIGIT + BITSPERDIG = Bug::Bignum::BITSPERDIG + BDIGMAX = (1 << BITSPERDIG) - 1 - def test_divrem_normal - x = (1 << (BITSPERDIG*2)) | (2 << BITSPERDIG) | 3 - y = (1 << BITSPERDIG) | 1 - q = (1 << BITSPERDIG) | 1 - r = 2 - assert_equal([q, r], Bug::Bignum.big_divrem_normal(x, y)) - end + def test_divrem_normal + x = (1 << (BITSPERDIG*2)) | (2 << BITSPERDIG) | 3 + y = (1 << BITSPERDIG) | 1 + q = (1 << BITSPERDIG) | 1 + r = 2 + assert_equal([q, r], Bug::Bignum.big_divrem_normal(x, y)) + end - def test_divrem_gmp - x = (1 << (BITSPERDIG*2)) | (2 << BITSPERDIG) | 3 - y = (1 << BITSPERDIG) | 1 - q = (1 << BITSPERDIG) | 1 - r = 2 - assert_equal([q, r], Bug::Bignum.big_divrem_gmp(x, y)) - rescue NotImplementedError - end + def test_divrem_gmp + x = (1 << (BITSPERDIG*2)) | (2 << BITSPERDIG) | 3 + y = (1 << BITSPERDIG) | 1 + q = (1 << BITSPERDIG) | 1 + r = 2 + assert_equal([q, r], Bug::Bignum.big_divrem_gmp(x, y)) + rescue No (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/