Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add the NSArray tests about #122 and #123

  • Loading branch information...
commit 1a4629b39ff6957a102b5527327f384d7d967de5 1 parent aabbd1e
@Watson1978 Watson1978 authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 test-mri/test/ruby/test_nsarray.rb
View
12 test-mri/test/ruby/test_nsarray.rb
@@ -647,6 +647,12 @@ def test_each
assert_equal(0, i)
assert_equal(a, a.each {})
+
+ a = @cls[1, 2, 5, 3, 4, 2]
+ b = a.each { |e|
+ a.delete(e) if e == 2
+ }
+ assert_equal(b, a)
end
def test_each_index
@@ -667,6 +673,12 @@ def test_each_index
assert_equal(0, i)
assert_equal(a, a.each_index {})
+
+ a = @cls[1, 2, 5, 3, 4, 2]
+ b = a.each_index { |ind|
+ a.delete_at(ind) if ind == 2
+ }
+ assert_equal(b, a)
end
def test_empty?
Please sign in to comment.
Something went wrong with that request. Please try again.