Skip to content

Commit

Permalink
* Add test case for empty array and first method with args.
Browse files Browse the repository at this point in the history
  Patch by @yui-knk [fix rubyGH-955]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
hsbt committed Jul 4, 2015
1 parent a894e92 commit aebf152
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
Sat Jul 4 19:43:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>

* Add test case for empty array and first method with args.
Patch by @yui-knk [fix GH-955]

Sat Jul 4 19:39:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>

* Add test for `Enumerable#sort` with block. Patch by @yui-knk
Expand Down
1 change: 1 addition & 0 deletions enum.c
Expand Up @@ -828,6 +828,7 @@ static VALUE enum_take(VALUE obj, VALUE n);
* %w[foo bar baz].first(2) #=> ["foo", "bar"]
* %w[foo bar baz].first(10) #=> ["foo", "bar", "baz"]
* [].first #=> nil
* [].first(10) #=> []
*
*/

Expand Down
1 change: 1 addition & 0 deletions test/ruby/test_enum.rb
Expand Up @@ -202,6 +202,7 @@ def test_first
assert_equal(1, @obj.first)
assert_equal([1, 2, 3], @obj.first(3))
assert_nil(@empty.first)
assert_equal([], @empty.first(10))

bug5801 = '[ruby-dev:45041]'
assert_in_out_err([], <<-'end;', [], /unexpected break/)
Expand Down

0 comments on commit aebf152

Please sign in to comment.