X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Fi386%2Flibhtml-parser-perl%2Flibhtml-parser-perl-3.56%2Ft%2Fprocess.t;fp=dev%2Fi386%2Flibhtml-parser-perl%2Flibhtml-parser-perl-3.56%2Ft%2Fprocess.t;h=9d27250a92fcdc067e3b0554405ee96bdac69b1c;hp=0000000000000000000000000000000000000000;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hpb=df794b845212301ea0d267c919232538bfef356a diff --git a/dev/i386/libhtml-parser-perl/libhtml-parser-perl-3.56/t/process.t b/dev/i386/libhtml-parser-perl/libhtml-parser-perl-3.56/t/process.t new file mode 100644 index 0000000..9d27250 --- /dev/null +++ b/dev/i386/libhtml-parser-perl/libhtml-parser-perl-3.56/t/process.t @@ -0,0 +1,43 @@ +use strict; + +use Test::More tests => 12; + +my $pi; +my $orig; + +use HTML::Parser (); +my $p = HTML::Parser->new(process_h => [sub { $pi = shift; $orig = shift; }, + "token0,text"] + ); + +$p->parse(""); + +is($pi, "foo"); +is($orig, ""); + +$p->parse(""); +is($pi, ""); +is($orig, ""); + +$p->parse(""); +is($pi, "\nfoo\n"); +is($orig, ""); + +for (qw(< a > < ? b a r > < a >)) { + $p->parse($_); +} + +is($pi, "bar"); +is($orig, ""); + +$p->xml_mode(1); + +$p->parse("bar??>"); +is($pi, "foo>bar?"); +is($orig, "bar??>"); + +$p->parse(""); +is($pi, ""); +is($orig, "");