From 86aa98fed4de1be2e868877fd786d3616d6c6ad5 Mon Sep 17 00:00:00 2001 From: charliesome Date: Fri, 1 Feb 2013 14:05:49 +0000 Subject: * array.c (rb_ary_dup): make returned array the same class as the original array [Bug #7768] [ruby-core:51792] * test/ruby/test_array.rb (class TestArray): add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_array.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 3ab0895f8c..c231ecccd1 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -2283,4 +2283,11 @@ class TestArray < Test::Unit::TestCase assert_include([4, 7], a.bsearch {|x| (2**100).coerce((1 - x / 4) * (2**100)).first }) end + + def test_array_uniq_returns_same_class # [ruby-core:51792] + klass = Class.new(Array) + assert_equal klass, klass.new(2).uniq.class + assert_equal klass, klass.new(1).uniq.class + assert_equal klass, klass.new(0).uniq.class + end end -- cgit v1.2.3