diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-20 19:09:03 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-20 19:09:03 +0000 |
commit | 3fffbe1e82d974a3bb6cdba58733086a369d4b06 (patch) | |
tree | 609cd4df9ca6a7bcc63be5b00b5218c48ee86309 /test/ruby/test_enumerator.rb | |
parent | 2d3724e05833f79e19f729195fdf0f01f081c5a6 (diff) | |
download | ruby-3fffbe1e82d974a3bb6cdba58733086a369d4b06.tar.gz |
* test/ruby/test_enumerator.rb: fix last commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r-- | test/ruby/test_enumerator.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 60864258c3..885cb4a5fe 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -4,14 +4,14 @@ class TestEnumerator < Test::Unit::TestCase def enum_test obj
i = 0
obj.map{|e|
- [i+=1, e]
+ e
}.sort
end
def test_iterators
- assert_equal [[1, 0], [2, 1], [3, 2]], enum_test(3.times)
- assert_equal [[1, :x], [2, :y], [3, :z]], enum_test([:x, :y, :z].each)
- assert_equal [[1, [:x, 1]], [2, [:y, 2]]], enum_test({:x=>1, :y=>2})
+ assert_equal [0, 1, 2], enum_test(3.times)
+ assert_equal [:x, :y, :z], enum_test([:x, :y, :z].each)
+ assert_equal [[:x, 1], [:y, 2]], enum_test({:x=>1, :y=>2})
end
## Enumerator as Iterator
|