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
|
BEGIN {print "1..3\n";}
END {print "not ok 1\n" unless $loaded;}
use XML::DOM;
use CheckAncestors;
use CmpDOM;
$loaded = 1;
print "ok 1\n";
my $test = 1;
sub assert_ok
{
my $ok = shift;
print "not " unless $ok;
++$test;
print "ok $test\n";
$ok;
}
#Test 2
my $str = <<END;
<?xml version="1.0"?>
<elt attr="foo & bar ]]>"/>
END
my $expected = <<END;
<?xml version="1.0"?>
<elt attr="foo & bar ]]>"/>
END
my $parser = new XML::DOM::Parser;
my $doc = $parser->parse ($str);
assert_ok (not $@);
my $out = $doc->toString;
assert_ok ($out eq $expected);
|