File: options.t

package info (click to toggle)
libhtml-parser-perl 3.56-1%2Blenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 536 kB
  • ctags: 192
  • sloc: ansic: 1,985; perl: 1,935; makefile: 43
file content (36 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);