Skip to content

Commit

Permalink
add the NSArray tests about #122 and #123
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jul 5, 2012
1 parent aabbd1e commit 1a4629b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test-mri/test/ruby/test_nsarray.rb
Expand Up @@ -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
Expand All @@ -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?
Expand Down

0 comments on commit 1a4629b

Please sign in to comment.