mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
test/lib/test/unit/assertions.rb defines assert_fixnum and assert_bignum.
* test/lib/test/unit/assertions.rb (assert_fixnum): Defined. (assert_bignum): Defined. * test/ruby/test_bignum.rb: Use assert_bignum. * test/ruby/test_integer_comb.rb: Use assert_fixnum and assert_bignum. * test/ruby/test_optimization.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0963d96e52
commit
5ea4824508
5 changed files with 42 additions and 23 deletions
|
@ -25,8 +25,8 @@ class TestRubyOptimization < Test::Unit::TestCase
|
|||
def test_fixnum_plus
|
||||
a, b = 1, 2
|
||||
assert_equal 3, a + b
|
||||
assert_instance_of Fixnum, FIXNUM_MAX
|
||||
assert_instance_of Bignum, FIXNUM_MAX + 1
|
||||
assert_fixnum FIXNUM_MAX
|
||||
assert_bignum FIXNUM_MAX + 1
|
||||
|
||||
assert_equal 21, 10 + 11
|
||||
assert_redefine_method('Fixnum', '+', 'assert_equal 11, 10 + 11')
|
||||
|
@ -34,8 +34,8 @@ class TestRubyOptimization < Test::Unit::TestCase
|
|||
|
||||
def test_fixnum_minus
|
||||
assert_equal 5, 8 - 3
|
||||
assert_instance_of Fixnum, FIXNUM_MIN
|
||||
assert_instance_of Bignum, FIXNUM_MIN - 1
|
||||
assert_fixnum FIXNUM_MIN
|
||||
assert_bignum FIXNUM_MIN - 1
|
||||
|
||||
assert_equal 5, 8 - 3
|
||||
assert_redefine_method('Fixnum', '-', 'assert_equal 3, 8 - 3')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue