* test/ruby/test_iterator.rb (TestIterator::IterTest::each):

#each_pair is now alias to #each.  [ruby-dev:32192]

* test/ruby/test_iterator.rb (TestIterator::test_assoc_yield):
  ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-11-09 04:46:58 +00:00
parent 4ab384be2d
commit 364f0bfe9f
2 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,11 @@
Fri Nov 9 13:45:05 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* test/ruby/test_iterator.rb (TestIterator::IterTest::each):
#each_pair is now alias to #each. [ruby-dev:32192]
* test/ruby/test_iterator.rb (TestIterator::test_assoc_yield):
ditto
Fri Nov 9 12:56:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri Nov 9 12:56:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval_load.c (loaded_feature_path): check with type of given feature. * eval_load.c (loaded_feature_path): check with type of given feature.

View File

@ -361,10 +361,7 @@ class TestIterator < Test::Unit::TestCase
def each def each
yield [:key, :value] yield [:key, :value]
end end
alias each_pair each
def each_pair
yield :key, :value
end
end end
def test_assoc_yield def test_assoc_yield
@ -373,9 +370,9 @@ class TestIterator < Test::Unit::TestCase
h.each{|a,| assert_equal(:key, a)} h.each{|a,| assert_equal(:key, a)}
h.each{|*a| assert_equal([[:key, :value]], a)} h.each{|*a| assert_equal([[:key, :value]], a)}
h.each{|k,v| assert_equal([:key, :value], [k,v])} h.each{|k,v| assert_equal([:key, :value], [k,v])}
h.each_pair{|a| assert_equal(:key, a)} h.each_pair{|a| assert_equal([:key, :value], a)}
h.each_pair{|a,| assert_equal(:key, a)} h.each_pair{|a,| assert_equal(:key, a)}
h.each_pair{|*a| assert_equal([:key, :value], a)} h.each_pair{|*a| assert_equal([[:key, :value]], a)}
h.each_pair{|k,v| assert_equal([:key, :value], [k,v])} h.each_pair{|k,v| assert_equal([:key, :value], [k,v])}
} }
end end