From c0bdb2511d898cb875e75dc1e7f774112e5341f9 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 5 Feb 2014 11:29:40 +0000 Subject: merge revision(s) 44512: [Backport #9340] * array.c (ary_add_hash): Fix consistency issue between Array#uniq and Array#uniq! [Bug #9340] [ruby-core:59457] * test/ruby/test_array.rb (class TestArray): regression test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby/test_array.rb') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index b648c404ed..6ff304acb2 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1524,6 +1524,11 @@ class TestArray < Test::Unit::TestCase assert(a.none?(&:frozen?)) assert_equal(%w(a), b) assert(b.none?(&:frozen?)) + + bug9340 = "[ruby-core:59457]" + ary = [bug9340, bug9340.dup, bug9340.dup] + assert_equal 1, ary.uniq.size + assert_same bug9340, ary.uniq[0] end def test_uniq_with_block -- cgit v1.2.3