From c0e1f9e016a24300a7047bb7e7cb3dd1f283463e Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 3 Sep 2013 11:20:17 +0000 Subject: Add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/bignum/test_big2str.rb | 6 ++++++ test/-ext-/bignum/test_mul.rb | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'test') diff --git a/test/-ext-/bignum/test_big2str.rb b/test/-ext-/bignum/test_big2str.rb index 3e45232d6c..f03d2328a1 100644 --- a/test/-ext-/bignum/test_big2str.rb +++ b/test/-ext-/bignum/test_big2str.rb @@ -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 diff --git a/test/-ext-/bignum/test_mul.rb b/test/-ext-/bignum/test_mul.rb index e462506e9f..7841dfffb2 100644 --- a/test/-ext-/bignum/test_mul.rb +++ b/test/-ext-/bignum/test_mul.rb @@ -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 -- cgit v1.2.3