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

* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):

use more descriptive assertions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-29 05:46:04 +00:00
parent e1cc514073
commit 921b2d1cfb
10 changed files with 25 additions and 21 deletions

View file

@ -103,15 +103,15 @@ class TestFixnum < Test::Unit::TestCase
end
def test_lshift
assert_equal(0x40000000, 0x20000000<<1)
assert_equal(-0x40000000, (-0x20000000)<<1)
assert_equal(-0x80000000, (-0x40000000)<<1)
assert_equal(0x40000000, 0x20000000 << 1)
assert_equal(-0x40000000, (-0x20000000) << 1)
assert_equal(-0x80000000, (-0x40000000) << 1)
end
def test_rshift
assert_equal(0x20000000, 0x40000000>>1)
assert_equal(-0x20000000, (-0x40000000)>>1)
assert_equal(-0x40000000, (-0x80000000)>>1)
assert_equal(0x20000000, 0x40000000 >> 1)
assert_equal(-0x20000000, (-0x40000000) >> 1)
assert_equal(-0x40000000, (-0x80000000) >> 1)
end
def test_abs
@ -187,7 +187,7 @@ class TestFixnum < Test::Unit::TestCase
assert_equal(4, 2**((2**32).coerce(2).first))
assert_equal(2, 4**0.5)
assert_equal(0, 0**0.5)
assert((0**-1.0).infinite?)
assert_equal(1, (0**-1.0).infinite?)
### rational changes the behavior of Fixnum#**
#assert_raise(TypeError) { 1 ** nil }
assert_raise(TypeError, NoMethodError) { 1 ** nil }