mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_array.rb: Add test cases for Array#sum with
non-numeric objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
65a1cdafc8
commit
7e5b1b65f5
2 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Apr 24 09:32:12 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_array.rb: Add test cases for Array#sum with
|
||||
non-numeric objects.
|
||||
|
||||
Sun Apr 24 04:21:27 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.c (INLINE): define as `inline` when it is optimized.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue