1
0
Fork 0
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:
nobu 2016-08-13 14:04:21 +00:00
parent a2a6c98e51
commit 85512bdbde

View file

@ -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)