Skip to content

Commit

Permalink
Simplified LOAD_PATH delegation for assert_in_out_err
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jan 18, 2024
1 parent 1bbca81 commit bf5ebd0
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions test/bigdecimal/test_bigdecimal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1768,11 +1768,7 @@ 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}
# for test-bundled-gems in ruby/ruby repository
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, expect, [], bug3258)
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, expect, [], bug3258)
GC.stress = true
10.upto(20) do |i|
p BigDecimal("1"+"0"*i).split
Expand All @@ -1781,11 +1777,7 @@ def test_split_under_gc_stress
end

def test_coerce_under_gc_stress
# for test-bundled-gems in ruby/ruby repository
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
b = BigDecimal("1")
GC.stress = true
Expand Down Expand Up @@ -1892,11 +1884,7 @@ def test_BigMath_exp_with_rational
end

def test_BigMath_exp_under_gc_stress
# for test-bundled-gems in ruby/ruby repository
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
10.times do
begin
Expand Down Expand Up @@ -2038,11 +2026,7 @@ def test_BigMath_log_with_reciprocal_of_42
end

def test_BigMath_log_under_gc_stress
# for test-bundled-gems in ruby/ruby repository
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
10.times do
begin
Expand Down Expand Up @@ -2089,11 +2073,7 @@ def test_to_d
end if RUBY_VERSION < '2.5' # mathn was removed from Ruby 2.5

def test_bug6406
# for test-bundled-gems in ruby/ruby repository
extension_paths = Dir.glob(File.expand_path('../../../../../.bundle/extensions', __dir__) + '/**/*/bigdecimal-*').join(":")
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
assert_in_out_err(["-I#{$LOAD_PATH.join(":")}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
Thread.current.keys.to_s
EOS
end
Expand Down

0 comments on commit bf5ebd0

Please sign in to comment.