Sha256: 2ca282848aefc547c723bba3d1ca9836080dae68a447dd12fa775a2361f9d9f7
Contents?: true
Size: 519 Bytes
Versions: 2
Compression:
Stored size: 519 Bytes
Contents
require './test_helper' 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gmp-0.5.41 | test/tc_zerodivisionexceptions.rb |
gmp-0.5.41-x86-mingw32 | test/tc_zerodivisionexceptions.rb |