rewrite home page redirect
[dh-make-perl] / dev / arm / libhtml-parser-perl / libhtml-parser-perl-3.56 / t / options.t
1 # Test option setting methods
2
3 use Test::More tests => 10;
4
5 use strict;
6 use HTML::Parser ();
7
8 my $p = HTML::Parser->new(api_version => 3,
9                           xml_mode => 1);
10 my $old;
11
12 $old = $p->boolean_attribute_value("foo");
13 ok(!defined $old);
14
15 $old = $p->boolean_attribute_value();
16 is($old, "foo");
17
18 $old = $p->boolean_attribute_value(undef);
19 is($old, "foo");
20 ok(!defined($p->boolean_attribute_value));
21
22 ok($p->xml_mode(0));
23 ok(!$p->xml_mode);
24
25 my $seen_buggy_comment_warning;
26 $SIG{__WARN__} =
27     sub {
28         local $_ = shift;
29         $seen_buggy_comment_warning++
30             if /^netscape_buggy_comment\(\) is deprecated/;
31     };
32
33 ok(!$p->strict_comment(1));
34 ok($p->strict_comment);
35 ok(!$p->netscape_buggy_comment);
36 ok($seen_buggy_comment_warning);