1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

@ -4,7 +4,7 @@ Mon Jan 31 04:45:12 2011 NARUSE, Yui <naruse@ruby-lang.org>
rb_resize_capa because rb_resize_capa expects resized length is
smaller than current array length. call rb_ary_unshare before
rb_resize_capa because rb_resize_capa losts the reference to
original shared array.
original shared array. [ruby-core:34997]
Sun Jan 30 17:19:46 2011 Tanaka Akira <akr@fsij.org>

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