Add ML Reference and a test for r30736 [ruby-core:34997]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2011-01-30 21:00:04 +00:00
parent a6d0cd442b
commit a924b1768f
2 changed files with 7 additions and 1 deletions

View file

@ -1456,6 +1456,12 @@ class TestArray < Test::Unit::TestCase
assert_raise(ArgumentError) { a.uniq!(1) }
assert_raise(ArgumentError) { f.uniq!(1) }
assert_raise(RuntimeError) { f.uniq! }
assert_nothing_raised do
a = [ {c: "b"}, {c: "r"}, {c: "w"}, {c: "g"}, {c: "g"} ]
a.sort_by!{|e| e[:c]}
a.uniq! {|e| e[:c]}
end
end
def test_uniq_bang_with_block