Skip to content

Commit

Permalink
Added current directory to LOAD_PATH of assert_in_out_err for test-bu…
Browse files Browse the repository at this point in the history
…ndled-gems at ruby/ruby
  • Loading branch information
hsbt committed Jan 17, 2024
1 parent 5843c89 commit 55a9f83
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/bigdecimal/test_bigdecimal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 55a9f83

Please sign in to comment.