mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby: better assertions
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
287d2adab0
commit
3ac0ec4ecd
45 changed files with 532 additions and 510 deletions
|
@ -206,8 +206,14 @@ class TestIntegerComb < Test::Unit::TestCase
|
|||
check_class(q)
|
||||
check_class(r)
|
||||
assert_equal(a, b*q+r)
|
||||
assert(r.abs < b.abs)
|
||||
assert(0 < b ? (0 <= r && r < b) : (b < r && r <= 0))
|
||||
assert_operator(r.abs, :<, b.abs)
|
||||
if 0 < b
|
||||
assert_operator(r, :>=, 0)
|
||||
assert_operator(r, :<, b)
|
||||
else
|
||||
assert_operator(r, :>, b)
|
||||
assert_operator(r, :<=, 0)
|
||||
end
|
||||
assert_equal(q, a/b)
|
||||
assert_equal(q, a.div(b))
|
||||
assert_equal(r, a%b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue