diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/-ext-/bignum/test_div.rb | 9 | ||||
-rw-r--r-- | test/ruby/test_bignum.rb | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/-ext-/bignum/test_div.rb b/test/-ext-/bignum/test_div.rb index ec12e88c91..882d2d164f 100644 --- a/test/-ext-/bignum/test_div.rb +++ b/test/-ext-/bignum/test_div.rb @@ -15,5 +15,14 @@ class TestBignum < Test::Unit::TestCase r = 2 assert_equal([q, r], x.big_divrem_normal(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], x.big_divrem_gmp(y)) + rescue NotImplementedError + end end end diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 5a91a2a6b6..4d87d5fca3 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -598,6 +598,9 @@ class TestBignum < Test::Unit::TestCase end def test_interrupt_during_bigdivrem + if defined?(Bignum::GMP_VERSION) + return # GMP doesn't support interrupt during an operation. + end return unless Process.respond_to?(:kill) begin trace = [] |