diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-15 06:27:30 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-15 06:27:30 +0000 |
commit | 723cee93c481e62579e5353d9128e1538381cbab (patch) | |
tree | dcd59219045d5b5ad7dc913b520239d47b6f2ca6 /test | |
parent | e02c5f346fd54d9183aaba3eab517bcf7a0613f1 (diff) | |
download | ruby-723cee93c481e62579e5353d9128e1538381cbab.tar.gz |
enum.c: nil if no iteration
* enum.c (enum_inject): return nil if no iteration, instead of
Qundef.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enum.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index 6448796790..8bcf929690 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -151,6 +151,7 @@ class TestEnumerable < Test::Unit::TestCase assert_equal(12, @obj.inject(:*)) assert_equal(24, @obj.inject(2) {|z, x| z * x }) assert_equal(24, @obj.inject(2, :*) {|z, x| z * x }) + assert_equal(nil, @empty.inject() {9}) end def test_partition |