From b9f67c4149f5f8888ac4681e15695deecd213136 Mon Sep 17 00:00:00 2001 From: shugo Date: Mon, 26 Mar 2012 10:52:02 +0000 Subject: * enumerator.c (inspect_enumerator): show method arguments of lazy enumerators correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_lazy_enumerator.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index d51b33bde4..6920ace34f 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -291,9 +291,21 @@ class TestLazyEnumerator < Test::Unit::TestCase "foo".chars.lazy.inspect) assert_equal("#:map>", (1..10).lazy.map {}.inspect) - l = (1..10).lazy.map {}.collect {}.flat_map {}.collect_concat {}.select {}.find_all {}.reject {}.grep(1).zip(?a..?c).take(10).take_while {}.drop(3).drop_while {}.cycle + assert_equal("#:take(0)>", + (1..10).lazy.take(0).inspect) + assert_equal("#:take(3)>", + (1..10).lazy.take(3).inspect) + assert_equal('#:grep(/b/)>', + ("a".."c").lazy.grep(/b/).inspect) + assert_equal("#:cycle(3)>", + (1..10).lazy.cycle(3).inspect) + assert_equal("#:cycle>", + (1..10).lazy.cycle.inspect) + assert_equal("#:cycle(3)>", + (1..10).lazy.cycle(3).inspect) + l = (1..10).lazy.map {}.collect {}.flat_map {}.collect_concat {}.select {}.find_all {}.reject {}.grep(1).zip(?a..?c).take(10).take_while {}.drop(3).drop_while {}.cycle(3) assert_equal(<:map>:collect>:flat_map>:collect_concat>:select>:find_all>:reject>:grep>:zip>:take>:take_while>:drop>:drop_while>:cycle> +#:map>:collect>:flat_map>:collect_concat>:select>:find_all>:reject>:grep(1)>:zip("a".."c")>:take(10)>:take_while>:drop(3)>:drop_while>:cycle(3)> EOS end end -- cgit v1.2.3