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/options.t | |
download | HTML-Parser-tarball-master.tar.gz |
HTML-Parser-3.71HEADHTML-Parser-3.71master
Diffstat (limited to 't/options.t')
-rw-r--r-- | t/options.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/options.t b/t/options.t new file mode 100644 index 0000000..ff5f7db --- /dev/null +++ b/t/options.t @@ -0,0 +1,36 @@ +# Test option setting methods + +use Test::More tests => 10; + +use strict; +use HTML::Parser (); + +my $p = HTML::Parser->new(api_version => 3, + xml_mode => 1); +my $old; + +$old = $p->boolean_attribute_value("foo"); +ok(!defined $old); + +$old = $p->boolean_attribute_value(); +is($old, "foo"); + +$old = $p->boolean_attribute_value(undef); +is($old, "foo"); +ok(!defined($p->boolean_attribute_value)); + +ok($p->xml_mode(0)); +ok(!$p->xml_mode); + +my $seen_buggy_comment_warning; +$SIG{__WARN__} = + sub { + local $_ = shift; + $seen_buggy_comment_warning++ + if /^netscape_buggy_comment\(\) is deprecated/; + }; + +ok(!$p->strict_comment(1)); +ok($p->strict_comment); +ok(!$p->netscape_buggy_comment); +ok($seen_buggy_comment_warning); |