summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--enum.c1
-rw-r--r--test/ruby/test_enum.rb1
3 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c6d4a1..2832d93 100644
--- a/ChangeLog
+++ b/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
diff --git a/enum.c b/enum.c
index e704a0d..c3002cb 100644
--- a/enum.c
+++ b/enum.c
@@ -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) #=> []
*
*/
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index 92c0322..0370508 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -202,6 +202,7 @@ class TestEnumerable < Test::Unit::TestCase
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/)