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