diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-01 22:17:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-01 22:17:46 +0000 |
commit | e7047b8a373f12ee8debb9f13e2940e17aa5f10e (patch) | |
tree | f99b0284b425d1946fdd3ba6355714f7c57aca2f /test/ruby/test_array.rb | |
parent | a943788fb748d7d99e6f9500da1e9cf02854cdd5 (diff) |
* array.c (rb_ary_reject_bang, rb_ary_delete_if): rejected
elements should be removed. fixed [Bug #2545]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 703c417d32..a22412c70c 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -607,6 +607,11 @@ class TestArray < Test::Unit::TestCase a = @cls[ 1, 2, 3, 4, 5 ] assert_equal(a, a.delete_if { |i| i > 3 }) assert_equal(@cls[1, 2, 3], a) + + bug2545 = '[ruby-core:27366]' + a = @cls[ 5, 6, 7, 8, 9, 10 ] + assert_equal(9, a.delete_if {|i| break i if i > 8; i < 7}) + assert_equal(@cls[7, 8], a, bug2545) end def test_dup @@ -1087,6 +1092,11 @@ class TestArray < Test::Unit::TestCase a = @cls[ 1, 2, 3, 4, 5 ] assert_equal(a, a.reject! { |i| i > 3 }) assert_equal(@cls[1, 2, 3], a) + + bug2545 = '[ruby-core:27366]' + a = @cls[ 5, 6, 7, 8, 9, 10 ] + assert_equal(9, a.reject! {|i| break i if i > 8; i < 7}) + assert_equal(@cls[7, 8], a, bug2545) end def test_replace |