diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-12-04 15:31:51 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-12-04 15:32:49 +0900 |
commit | 00bbdf4451d0e66f0f7823e77c47ac310614c1c3 (patch) | |
tree | 3be13b816dbaaa059709a79018cbc584d87e881f /test/ruby | |
parent | c6e3db0c66312af1e932c21006437419efa9ac75 (diff) | |
download | ruby-00bbdf4451d0e66f0f7823e77c47ac310614c1c3.tar.gz |
implement Range#count
As matz requested in [Bug #16366].
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_range.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 4df14539a9..800cee92cc 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -950,4 +950,8 @@ class TestRange < Test::Unit::TestCase def test_beginless_range_iteration assert_raise(TypeError) { (..1).each { } } end + + def test_count + assert_equal(Float::INFINITY, (1..).count) + end end |