diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-24 15:53:38 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-24 15:53:38 +0000 |
commit | 0c9f66eb400a78ef2e201a30a3904f59033d0439 (patch) | |
tree | ae660e8809aba0e8ffd7c8b1b1d8d41c063db6ab /test/ruby/test_lazy_enumerator.rb | |
parent | fa288063e0159374a9a5f06a4d9b52785778b926 (diff) | |
download | ruby-0c9f66eb400a78ef2e201a30a3904f59033d0439.tar.gz |
* enumerator (lazy_initialize): set the instance variable "receiver"
to include the receiver to the return value of inspect on a lazy
enumerator directly created by Enumerator::Lazy.new.
* enumerator (RETURN_LAZY): don't set the instance variable "receiver".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lazy_enumerator.rb')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 6367d918a5..d51b33bde4 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -282,6 +282,10 @@ class TestLazyEnumerator < Test::Unit::TestCase end def test_inspect + assert_equal("#<Enumerator::Lazy: 1..10:each>", + Enumerator::Lazy.new(1..10).inspect) + assert_equal("#<Enumerator::Lazy: 1..10:cycle(2)>", + Enumerator::Lazy.new(1..10, :cycle, 2).inspect) assert_equal("#<Enumerator::Lazy: 1..10>", (1..10).lazy.inspect) assert_equal('#<Enumerator::Lazy: #<Enumerator: "foo":chars>>', "foo".chars.lazy.inspect) |