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
Родитель a6d0cd442b
Коммит a924b1768f
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

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

Просмотреть файл

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