008739e0adea3c1d71556bb85217469e02c530a3
[dh-make-perl] / dev / arm / libhtml-parser-perl / libhtml-parser-perl-3.56 / t / ignore.t
1
2 use Test::More tests => 4;
3
4 use strict;
5 use HTML::Parser ();
6
7 my $html = '<A href="foo">text</A>';
8
9 my $text = '';
10 my $p = HTML::Parser->new(default_h => [sub {$text .= shift;}, 'text']);
11 $p->parse($html)->eof;
12 is($text, $html);
13
14 $text = '';
15 $p->handler(start => "");
16 $p->parse($html)->eof;
17 is($text, 'text</A>');
18
19 $text = '';
20 $p->handler(end => 0);
21 $p->parse($html)->eof;
22 is($text, 'text');
23
24 $text = '';
25 $p->handler(start => undef);
26 $p->parse($html)->eof;
27 is($text, '<A href="foo">text');