summaryrefslogtreecommitdiff
path: root/t/api_version.t
blob: 98031216c48607f16c8081875176ce7869411583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use Test::More tests => 4;

use strict;
use HTML::Parser ();

my $p = HTML::Parser->new(api_version => 3);

ok(!$p->handler("start"), "API version 3");

my $failed;
eval {
   my $p = HTML::Parser->new(api_version => 4);
   $failed++;
};
like($@, qr/^API version 4 not supported/);
ok(!$failed, "API version 4");

$p = HTML::Parser->new(api_version => 2);

is($p->handler("start"), "start", "API version 2");