diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-25 07:17:36 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-25 07:17:36 -0700 |
commit | 8e1d46c7e197bb904b07b7f677ab4593030d57d2 (patch) | |
tree | 64132cec56772e6d106426d4c0c4c5f377fbd2df /activesupport/test/core_ext | |
parent | 56417b40921704a6139191f39b9a10f76e18d38e (diff) | |
parent | b4167d3f3e4d25be16e06e71afd1c64a47ca54d7 (diff) | |
download | rails-8e1d46c7e197bb904b07b7f677ab4593030d57d2.tar.gz rails-8e1d46c7e197bb904b07b7f677ab4593030d57d2.tar.bz2 rails-8e1d46c7e197bb904b07b7f677ab4593030d57d2.zip |
Merge pull request #6487 from avakhov/range-sum-optimization
Fix Range#sum optimized version
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index 0bf48dd378..0a1abac767 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -84,6 +84,11 @@ class EnumerableTests < ActiveSupport::TestCase assert_equal 10, (1..4.5).sum assert_equal 6, (1...4).sum assert_equal 'abc', ('a'..'c').sum + assert_equal 50_000_005_000_000, (0..10_000_000).sum + assert_equal 0, (10..0).sum + assert_equal 5, (10..0).sum(5) + assert_equal 10, (10..10).sum + assert_equal 42, (10...10).sum(42) end def test_index_by |