1 use Test::More tests => 6;
6 my $p = HTML::Parser->new(api_version => 3);
9 $p->handler(end => "end", q(xyzzy));
11 like($@, qr/^Unrecognized identifier xyzzy in argspec/);
15 $p->handler(end => "end", q(tagname text));
17 like($@, qr/^Missing comma separator in argspec/);
21 $p->handler(end => "end", q(tagname, "text));
23 like($@, qr/^Unterminated literal string in argspec/);
27 $p->handler(end => "end", q(tagname, "t\\t"));
29 like($@, qr/^Backslash reserved for literal string in argspec/);
32 $p->handler(end => "end", '"' . ("x" x 256) . '"');
34 like($@, qr/^Literal string is longer than 255 chars in argspec/);
36 $p->handler(end => sub { is(length(shift), 255) },
37 '"' . ("x" x 255) . '"');