use Test::More tests => 4;
use strict;
use HTML::Parser ();
my $html = 'text';
my $text = '';
my $p = HTML::Parser->new(default_h => [sub {$text .= shift;}, 'text']);
$p->parse($html)->eof;
is($text, $html);
$text = '';
$p->handler(start => "");
$p->parse($html)->eof;
is($text, 'text');
$text = '';
$p->handler(end => 0);
$p->parse($html)->eof;
is($text, 'text');
$text = '';
$p->handler(start => undef);
$p->parse($html)->eof;
is($text, 'text');