diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2013-05-08 22:21:52 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2013-05-08 22:21:52 +0000 |
commit | 2f253cfc85ffd55a8acb988e91f0bc5ab348124c (patch) | |
tree | 4734ccd522c71dd455879162006742002f8c1565 /t/api_version.t | |
download | HTML-Parser-tarball-master.tar.gz |
HTML-Parser-3.71HEADHTML-Parser-3.71master
Diffstat (limited to 't/api_version.t')
-rw-r--r-- | t/api_version.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/api_version.t b/t/api_version.t new file mode 100644 index 0000000..9803121 --- /dev/null +++ b/t/api_version.t @@ -0,0 +1,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"); + + |