Skip to content

Commit

Permalink
Support ruby/bigdecimal repository cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jan 17, 2024
1 parent 55a9f83 commit 1bbca81
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 @@ -1770,7 +1770,9 @@ def test_split_under_gc_stress
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(":")
assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, expect, [], bug3258)
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, expect, [], bug3258)
GC.stress = true
10.upto(20) do |i|
p BigDecimal("1"+"0"*i).split
Expand All @@ -1781,7 +1783,9 @@ def test_split_under_gc_stress
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(":")
assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
b = BigDecimal("1")
GC.stress = true
Expand Down Expand Up @@ -1890,7 +1894,9 @@ def test_BigMath_exp_with_rational
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(":")
assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
10.times do
begin
Expand Down Expand Up @@ -2034,7 +2040,9 @@ def test_BigMath_log_with_reciprocal_of_42
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(":")
assert_in_out_err(["-I#{extension_paths}", "-rbigdecimal", "--disable-gems"], <<-EOS, [], [])
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
expect = ":too_long_to_embed_as_string can't be coerced into BigDecimal"
10.times do
begin
Expand Down Expand Up @@ -2083,7 +2091,9 @@ def test_to_d
def test_bug6406
# 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, [], [])
opts = ["-rbigdecimal", "--disable-gems"]
opts.unshift "-I#{extension_paths}" unless extension_paths.empty?
assert_in_out_err(opts, <<-EOS, [], [])
Thread.current.keys.to_s
EOS
end
Expand Down

0 comments on commit 1bbca81

Please sign in to comment.