summaryrefslogtreecommitdiff
path: root/test/ruby/test_lazy_enumerator.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-05 23:32:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-05 23:32:50 +0000
commit4b7f531553100afad272c7078b23e6e32989bc2a (patch)
tree454c368ed3e59dcc7071d7e9079611c9b7610487 /test/ruby/test_lazy_enumerator.rb
parent6c1f11592c6e8f5347b758e66c869bde7ca32733 (diff)
enum.c: check argument first
* enum.c (enum_cycle_size): check an argument before the size of the receiver, if it is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-rw-r--r--test/ruby/test_lazy_enumerator.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb
index 4db58e7619..56890f4b6e 100644
--- a/test/ruby/test_lazy_enumerator.rb
+++ b/test/ruby/test_lazy_enumerator.rb
@@ -507,7 +507,9 @@ EOS
def size; 0; end
include Enumerable
end
- assert_equal 0, obj.lazy.cycle.size
+ lazy = obj.lazy
+ assert_equal 0, lazy.cycle.size
+ assert_raise(TypeError) {lazy.cycle("").size}
end
def test_map_zip