diff --git a/ChangeLog b/ChangeLog index 0bdfc65ba3..1b45e422f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Apr 24 09:32:12 2016 Yuichiro Kaneko + + * test/ruby/test_array.rb: Add test cases for Array#sum with + non-numeric objects. + Sun Apr 24 04:21:27 2016 NARUSE, Yui * vm_insnhelper.c (INLINE): define as `inline` when it is optimized. diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 4ae5f9f820..36f2b7d72d 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -2786,6 +2786,9 @@ class TestArray < Test::Unit::TestCase assert_float_equal(large_number+(small_number*10), [large_number, *[small_number]*10].sum) assert_float_equal(large_number+(small_number*10), [large_number/1r, *[small_number]*10].sum) assert_float_equal(large_number+(small_number*11), [small_number, large_number/1r, *[small_number]*10].sum) + + assert_equal("abc", ["a", "b", "c"].sum("")) + assert_equal([1, [2], 3], [[1], [[2]], [3]].sum([])) end private