1 |
#!/usr/bin/perl |
#!/usr/bin/perl |
2 |
use strict; |
use strict; |
3 |
use Test; |
use Test; |
4 |
BEGIN { plan tests => 10 } |
BEGIN { plan tests => 21 } |
5 |
|
|
6 |
require Message::DOM::DOMImplementation; |
require Message::DOM::DOMImplementation; |
7 |
|
|
8 |
my $dom = Message::DOM::DOMImplementation->____new; |
my $dom = Message::DOM::DOMImplementation->new; |
9 |
|
|
10 |
ok $dom->isa ('Message::DOM::DOMImplementation'); |
ok $dom->isa ('Message::DOM::DOMImplementation'); |
11 |
ok $dom->isa ('Message::IF::DOMImplementation'); |
ok $dom->isa ('Message::IF::DOMImplementation'); |
12 |
|
|
13 |
## AUTOLOAD test |
## AUTOLOAD test |
14 |
ok $dom->can ('create_uri_reference'); |
{ |
15 |
my $uri = $dom->create_uri_reference ('http://www.uri.test/'); |
ok $dom->can ('create_uri_reference') ? 1 : 0, 1, "can create_uri_reference"; |
16 |
ok UNIVERSAL::isa ($uri, 'Message::IF::URIReference'); |
my $uri = $dom->create_uri_reference ('http://www.uri.test/'); |
17 |
|
ok UNIVERSAL::isa ($uri, 'Message::IF::URIReference'); |
18 |
ok $dom->can ('create_document'); |
} |
19 |
my $doc = $dom->create_document; |
|
20 |
ok UNIVERSAL::isa ($doc, 'Message::IF::Document'); |
{ |
21 |
|
ok $dom->can ('create_document') ? 1 : 0, 1, "can create_document"; |
22 |
ok $dom->can ('create_document_type'); |
my $doc = $dom->create_document; |
23 |
my $doc = $dom->create_document_type; |
ok UNIVERSAL::isa ($doc, 'Message::IF::Document'); |
24 |
ok UNIVERSAL::isa ($doc, 'Message::IF::DocumentType'); |
} |
25 |
|
|
26 |
|
{ |
27 |
|
ok $dom->can ('create_document_type') ? 1 : 0, 1, "can create_document_type"; |
28 |
|
my $doc = $dom->create_document_type; |
29 |
|
ok UNIVERSAL::isa ($doc, 'Message::IF::DocumentType'); |
30 |
|
} |
31 |
|
|
32 |
ok $dom->can ('no_such_method') ? 1 : 0, 0; |
ok $dom->can ('no_such_method') ? 1 : 0, 0; |
33 |
my $something_called = 0; |
my $something_called = 0; |
37 |
}; |
}; |
38 |
ok $something_called, 0; |
ok $something_called, 0; |
39 |
|
|
40 |
## License: Public Domain. |
require Message::DOM::DOMImplementationRegistry; |
41 |
|
F: for my $features ( |
42 |
|
{Core => '1.0'}, {XML => '1.0'}, {Core => '1.0', XML => '1.0'}, |
43 |
|
{Core => '2.0'}, {XML => '2.0'}, {Core => '2.0', XML => '2.0'}, |
44 |
|
{Core => '3.0'}, {XML => '3.0'}, {Core => '3.0', XML => '3.0'}, |
45 |
|
{XMLVersion => '1.0'}, {XMLVersion => '1.1'}, |
46 |
|
) { |
47 |
|
my $list = $Message::DOM::DOMImplementationRegistry |
48 |
|
->get_dom_implementation_list ($features); |
49 |
|
for my $impl (@$list) { |
50 |
|
if ($impl->isa ('Message::DOM::DOMImplementation')) { |
51 |
|
ok 1, 1, 'features: '. join ',', %$features; |
52 |
|
next F; |
53 |
|
} |
54 |
|
} |
55 |
|
} # F |
56 |
|
|
57 |
|
=head1 LICENSE |
58 |
|
|
59 |
|
Copyright 2007 Wakaba <w@suika.fam.cx> |
60 |
|
|
61 |
|
This program is free software; you can redistribute it and/or |
62 |
|
modify it under the same terms as Perl itself. |
63 |
|
|
64 |
|
=cut |
65 |
|
|
66 |
## $Date$ |
## $Date$ |