Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / libhtml-parser-perl / libhtml-parser-perl-3.56 / t / api_version.t
diff --git a/dev/i386/libhtml-parser-perl/libhtml-parser-perl-3.56/t/api_version.t b/dev/i386/libhtml-parser-perl/libhtml-parser-perl-3.56/t/api_version.t
new file mode 100644 (file)
index 0000000..9803121
--- /dev/null
@@ -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");
+
+