1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-09-03 11:20:17 +00:00
parent 2583689340
commit c0e1f9e016
2 changed files with 13 additions and 0 deletions

View file

@ -19,5 +19,11 @@ class TestBignum < Test::Unit::TestCase
assert_equal("1" + "0" * e, x.big2str_poweroftwo(2))
end
def test_big2str_gmp
x = 10**1000
assert_equal("1" + "0" * 1000, x.big2str_gmp(10))
rescue NotImplementedError
end
end
end

View file

@ -126,5 +126,12 @@ class TestBignum < Test::Unit::TestCase
assert_equal(x.big_mul_normal(y), x.big_mul_toom3(y))
end
def test_mul_gmp
x = (1 << 2*BITSPERDIG) | (1 << BITSPERDIG) | 1
y = (1 << 2*BITSPERDIG) | (1 << BITSPERDIG) | 1
assert_equal(x.big_mul_normal(y), x.big_mul_gmp(y))
rescue NotImplementedError
end
end
end