cpan/Test-Harness/t/lib/MyIterator.pm
raw| 1 | # subclass for testing customizing & subclassing |
| 2 | |
| 3 | package MyIterator; |
| 4 | |
| 5 | use strict; |
| 6 | use warnings; |
| 7 | |
| 8 | use base qw( TAP::Parser::Iterator MyCustom ); |
| 9 | |
| 10 | sub _initialize { |
| 11 | my $self = shift; |
| 12 | $self->SUPER::_initialize(@_); |
| 13 | $main::INIT{ ref($self) }++; |
| 14 | $self->{initialized} = 1; |
| 15 | $self->{content} = [ 'whats TAP all about then?', '1..1', 'ok 1' ]; |
| 16 | return $self; |
| 17 | } |
| 18 | |
| 19 | sub next { |
| 20 | return shift @{ $_[0]->{content} }; |
| 21 | } |
| 22 | |
| 23 | 1; |