mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_comparable.rb: fix clamp test
* test/ruby/test_comparable.rb (TestComparable#test_clamp): fix test. the result which is not clamped should be the receiver. [Feature #10594] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a2a6c98e51
commit
85512bdbde
1 changed files with 2 additions and 2 deletions
|
@ -80,10 +80,10 @@ class TestComparable < Test::Unit::TestCase
|
|||
cmp->(x) do 0 <=> x end
|
||||
assert_equal(1, @o.clamp(1, 2))
|
||||
assert_equal(-1, @o.clamp(-2, -1))
|
||||
assert_equal(0, @o.clamp(-1, 3))
|
||||
assert_equal(@o, @o.clamp(-1, 3))
|
||||
|
||||
assert_equal(1, @o.clamp(1, 1))
|
||||
assert_equal(0, @o.clamp(0, 0))
|
||||
assert_equal(@o, @o.clamp(0, 0))
|
||||
|
||||
assert_raise_with_message(ArgumentError, 'min argument must be smaller than max argument') {
|
||||
@o.clamp(2, 1)
|
||||
|
|
Loading…
Add table
Reference in a new issue