ruby-changes:43817
From: nobu <ko1@a...>
Date: Sat, 13 Aug 2016 23:04:25 +0900 (JST)
Subject: [ruby-changes:43817] nobu:r55890 (trunk): test_comparable.rb: fix clamp test
nobu 2016-08-13 23:04:21 +0900 (Sat, 13 Aug 2016) New Revision: 55890 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55890 Log: 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] Modified files: trunk/test/ruby/test_comparable.rb Index: test/ruby/test_comparable.rb =================================================================== --- test/ruby/test_comparable.rb (revision 55889) +++ test/ruby/test_comparable.rb (revision 55890) @@ -80,10 +80,10 @@ class TestComparable < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/ruby/test_comparable.rb#L80 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/