diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 14:53:56 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-20 14:53:56 +0000 |
commit | d77b1756fdfdc1ec6ab7ba26754da27d1492d169 (patch) | |
tree | 50287630dfc05ceffe3fcc8a6c8378a0848a6ded /test/ruby | |
parent | 1a028670e131ec1698a468f2089cfdfd7fe6b1f6 (diff) |
merge revision(s) 57649,57651: [Backport #13222]
array.c: finish_exact_sum
* array.c (finish_exact_sum): extract duplicate code from
rb_ary_sum.
array.c: check if numeric
* array.c (finish_exact_sum): add 0 and the initial value to check
if the latter is numeric. [ruby-core:79572] [Bug #13222]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_array.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 2701f988e3..42830063b5 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -2839,6 +2839,9 @@ class TestArray < Test::Unit::TestCase assert_equal("abc", ["a", "b", "c"].sum("")) assert_equal([1, [2], 3], [[1], [[2]], [3]].sum([])) + assert_raise(TypeError) {[0].sum("")} + assert_raise(TypeError) {[1].sum("")} + assert_separately(%w[-rmathn], <<-EOS, ignore_stderr: true) assert_equal(6, [1r, 2, 3r].sum) EOS |