Sha256: 6f0334784ff399de77cfd69b88d5e78a51806bc3ce9fe77c3062f2735555de6b

Contents?: true

Size: 493 Bytes

Versions: 21

Compression:

Stored size: 493 Bytes

Contents

class TC_ZeroDivisionExceptions < Test::Unit::TestCase
  def setup
    @a = GMP::Z.new(10)
    @b = GMP::Z.new()
    @c = GMP::Q.new(1)
    @d = GMP::Q.new()
  end
  
  def test_division_by_zero
    assert_raise(ZeroDivisionError) { @a.tdiv(0) }
    assert_raise(ZeroDivisionError) { @a.tdiv(@b) }
    assert_raise(ZeroDivisionError) { @d.inv }
    assert_raise(ZeroDivisionError) { @d.inv! }
    assert_raise(ZeroDivisionError) { @c/0 }
    assert_raise(ZeroDivisionError) { @c/@d }
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
srawlins-gmp-0.1.4.2 test/tc_zerodivisionexceptions.rb
srawlins-gmp-0.1.5.1 test/tc_zerodivisionexceptions.rb
srawlins-gmp-0.1.5 test/tc_zerodivisionexceptions.rb
gmp-0.5.23 test/tc_zerodivisionexceptions.rb
gmp-0.5.23-x86-mingw32 test/tc_zerodivisionexceptions.rb
gmp-0.5.3 test/tc_zerodivisionexceptions.rb
gmp-0.5.3-x86-mingw32 test/tc_zerodivisionexceptions.rb
gmp-0.4.7-x86_64-linux test/tc_zerodivisionexceptions.rb
gmp-0.4.7 test/tc_zerodivisionexceptions.rb
gmp-0.4.7-x86-mingw32 test/tc_zerodivisionexceptions.rb
gmp-0.4.3 test/tc_zerodivisionexceptions.rb
gmp-0.4.3-x86-mingw32 test/tc_zerodivisionexceptions.rb
gmp-0.4.1-x86-mingw32 test/tc_zerodivisionexceptions.rb
gmp-0.4.1 test/tc_zerodivisionexceptions.rb
gmp-0.4.0-x86-mingw32 test/tc_zerodivisionexceptions.rb
gmp-0.4.0 test/tc_zerodivisionexceptions.rb
gmp-0.2.2 test/tc_zerodivisionexceptions.rb
gmp-0.2.1 test/tc_zerodivisionexceptions.rb
gmp-0.1.9 test/tc_zerodivisionexceptions.rb
gmp-0.1.8 test/tc_zerodivisionexceptions.rb