From 55a9f83d49235c0690bde632f85fa0b8dedd83b2 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 17 Jan 2024 13:24:18 +0900 Subject: [PATCH] Added current directory to LOAD_PATH of assert_in_out_err for test-bundled-gems at ruby/ruby --- test/bigdecimal/test_bigdecimal.rb | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index b28242b7..f4b54901 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -1768,7 +1768,9 @@ def test_ctov def test_split_under_gc_stress bug3258 = '[ruby-dev:41213]' expect = 10.upto(20).map{|i|[1, "1", 10, i+1].inspect} - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, expect, [], bug3258) + # for test-bundled-gems in ruby/ruby repository + extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":") + assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, expect, [], bug3258) GC.stress = true 10.upto(20) do |i| p BigDecimal("1"+"0"*i).split @@ -1777,7 +1779,9 @@ def test_split_under_gc_stress end def test_coerce_under_gc_stress - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) + # for test-bundled-gems in ruby/ruby repository + extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":") + assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], []) expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" b = BigDecimal("1") GC.stress = true @@ -1884,7 +1888,9 @@ def test_BigMath_exp_with_rational end def test_BigMath_exp_under_gc_stress - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) + # for test-bundled-gems in ruby/ruby repository + extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":") + assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], []) expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" 10.times do begin @@ -2026,7 +2032,9 @@ def test_BigMath_log_with_reciprocal_of_42 end def test_BigMath_log_under_gc_stress - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) + # for test-bundled-gems in ruby/ruby repository + extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":") + assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], []) expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal" 10.times do begin @@ -2073,7 +2081,9 @@ def test_to_d end if RUBY_VERSION < '2.5' # mathn was removed from Ruby 2.5 def test_bug6406 - assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) + # for test-bundled-gems in ruby/ruby repository + extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":") + assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], []) Thread.current.keys.to_s EOS end