summaryrefslogtreecommitdiff
path: root/test/ruby/test_range.rb
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-12-04 15:31:51 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-12-04 15:32:49 +0900
commit00bbdf4451d0e66f0f7823e77c47ac310614c1c3 (patch)
tree3be13b816dbaaa059709a79018cbc584d87e881f /test/ruby/test_range.rb
parentc6e3db0c66312af1e932c21006437419efa9ac75 (diff)
implement Range#count
As matz requested in [Bug #16366].
Diffstat (limited to 'test/ruby/test_range.rb')
-rw-r--r--test/ruby/test_range.rb4
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