diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:15:00 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:15:00 +0000 |
commit | faed90d814d6739cc55e6f0103fdc06fc1c5de0a (patch) | |
tree | 96e82262e4324f3cf0c5669a335c25005a574e5e /test/ruby | |
parent | 28d8bf902d573236ee0bdfdc84de5d96deffefee (diff) | |
download | ruby-faed90d814d6739cc55e6f0103fdc06fc1c5de0a.tar.gz |
* range.c: Support for range.step.size
[Feature #6636]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_enumerator.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 8203aabc56..3ce471bb24 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -536,6 +536,12 @@ class TestEnumerator < Test::Unit::TestCase assert_equal 1, 42.step(Float::INFINITY, Float::INFINITY).size assert_equal 14, 0.1.step(4.2, 0.3).size assert_equal Float::INFINITY, 42.step(Float::INFINITY, 2).size + + assert_equal 10, (1..10).step.size + assert_equal 4, (1..10).step(3).size + assert_equal 3, (1...10).step(3).size + assert_equal Float::INFINITY, (42..Float::INFINITY).step(2).size + assert_raise(ArgumentError){ (1..10).step(-2).size } end end |