| 1 |
#!/usr/bin/perl |
#!/usr/bin/perl |
| 2 |
use strict; |
use strict; |
| 3 |
use Test; |
use Test; |
| 4 |
BEGIN { plan tests => 128 } |
BEGIN { plan tests => 139 } |
| 5 |
|
|
| 6 |
require Message::DOM::DOMImplementation; |
require Message::DOM::DOMImplementation; |
| 7 |
use Message::Util::Error; |
use Message::Util::Error; |
| 8 |
|
|
| 9 |
## TODO: |create_document| tests |
## TODO: |create_document| tests |
| 10 |
|
|
| 11 |
my $dom = Message::DOM::DOMImplementation->____new; |
my $dom = Message::DOM::DOMImplementation->new; |
| 12 |
my $doc = $dom->create_document; |
my $doc = $dom->create_document; |
| 13 |
|
|
| 14 |
## AUTOLOAD test |
## AUTOLOAD test |
| 156 |
$doc->strict_error_checking (1); |
$doc->strict_error_checking (1); |
| 157 |
} |
} |
| 158 |
|
|
| 159 |
for my $prop (qw/document_uri input_encoding/) { |
for my $prop (qw/document_uri input_encoding manakai_charset/) { |
| 160 |
ok $doc->can ($prop) ? 1 : 0, 1, 'can ' . $prop; |
ok $doc->can ($prop) ? 1 : 0, 1, 'can ' . $prop; |
| 161 |
|
|
| 162 |
for ('http://absuri.test/', 'reluri', 0, '') { |
for ('http://absuri.test/', 'reluri', 0, '') { |
| 168 |
ok $doc->$prop, undef, $prop . ' undef'; |
ok $doc->$prop, undef, $prop . ' undef'; |
| 169 |
} |
} |
| 170 |
|
|
| 171 |
for my $prop (qw/all_declarations_processed/) { |
for my $prop (qw/all_declarations_processed manakai_has_bom/) { |
| 172 |
ok $doc->can ($prop) ? 1 : 0, 1, 'can ' . $prop; |
ok $doc->can ($prop) ? 1 : 0, 1, 'can ' . $prop; |
| 173 |
|
|
| 174 |
for (1, 0, '') { |
for (1, 0, '') { |
| 275 |
my $doc2 = $doc->implementation->create_document; |
my $doc2 = $doc->implementation->create_document; |
| 276 |
my $doctype = $doc2->implementation->create_document_type ('dt'); |
my $doctype = $doc2->implementation->create_document_type ('dt'); |
| 277 |
my $el = $doc2->create_element_ns (undef, 'e'); |
my $el = $doc2->create_element_ns (undef, 'e'); |
| 278 |
my $comment = $doc->create_comment (''); |
my $comment = $doc2->create_comment (''); |
| 279 |
$doc2->append_child ($comment); |
$doc2->append_child ($comment); |
| 280 |
$doc2->append_child ($doctype); |
$doc2->append_child ($doctype); |
| 281 |
$doc2->append_child ($el); |
$doc2->append_child ($el); |