On Tuesday 19 September 2006 15:03, Ovid wrote:
> ----- Original Message ----
> From: Shlomi Fish
>
> > Switching to TAPx::Parser::Iterator :
> >
> > http://search.cpan.org/~ovid/TAPx-Parser-0.30/lib/TAPx/Parser/Iterator.pm
> >
> > Solved this problem.
> >
> > However, the TAPx::Parser::Iterator POD says:
> >
> > "FOR INTERNAL USE ONLY!".
>
> Can you send me a short code example of how you're using it?
>
Sure:
<<<<<<<<<
# $test_output_orig is a ref to an array.
sub analyze {
my($self, $name, $test_output_orig) = @_;
my $parser =
TAPx::Parser->new(
{
stream => TAPx::Parser::Iterator->new($test_output_orig),
}
);
return $self->_analyze_with_parser($name, $parser);
}
sub analyze_fh {
my($self, $name, $fh) = @_;
my $parser =
TAPx::Parser->new(
{
stream => TAPx::Parser::Iterator->new($fh),
}
);
return $self->_analyze_with_parser($name, $parser);
}
>>>>>>>>
That's it!
BTW, the documentation for the interface that the "stream => " argument
expects on the TAPx::Parser pod may be misleading:
http://search.cpan.org/~ovid/TAPx-Parser-0.30/lib/TAPx/Parser.pm
Reading from it:
<<<<<<<<<<<<
* stream
The value should be a code ref. Every every time the reference is called, it
should return a chunk of TAP. When no more tap is available, it should return
undef.
>>>>>>>>>>>>
> I think I may be able to remove that notice now, but I'm not quite ready to
> yet. Still, I do show provide examples of how to use it, so I guess that's
> contradictory. Oops.
Regards,
Shlomi Fish
---------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Homepage: http://www.shlomifish.org/
Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.