/[suikacvs]/messaging/manakai/t/DOM-Attr.t
Suika

Contents of /messaging/manakai/t/DOM-Attr.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download) (as text)
Sun Jun 17 13:37:42 2007 UTC (17 years, 5 months ago) by wakaba
Branch: MAIN
File MIME type: application/x-troff
++ manakai/t/ChangeLog	17 Jun 2007 13:37:22 -0000
2007-06-17  Wakaba  <wakaba@suika.fam.cx>

	* DOM-Attr.t, DOM-AttributeDefinition.t, DOM-DocumentType.t,
	DOM-Element.t, DOM-Entity.t, DOM-EntityReference.t,
	DOM-Notation.t, DOM-ProcessingInstruction.t: New.

	* DOM-Document.t, DOM-Node.t: Tests for newly-implemented attributes
	and methods are added.

	* Makefile (test-module-dom-old): Renamed from |test-module-dom|.
	(test-module-dom): New.

++ manakai/lib/Message/DOM/ChangeLog	17 Jun 2007 13:34:54 -0000
2007-06-17  Wakaba  <wakaba@suika.fam.cx>

	* Attr.pm (____new): Initialize |specified| as 1.
	(base_uri, manakai_attribute_type, specified): Implemented.
	(prefix): Don't check read-only flag unless |strict_error_checking|.
	(value): Call |text_content| for now.

	* AttributeDefinition.pm (DeclaredValueType, DefaultValueType): Added.
	(declared_type, default_type): Implemented.

	* CharacterData.pm (____new): Allow a scalar reference
	as an input for the |data| attribute.
	(base_uri, manakai_append_text): Implemented.

	* DOMConfiguration.pm (set_parameter): Resetting implemented.

	* DOMDocument.pm (____new): Set default values to
	configuration parameter whose default is true.
	(document_uri, input_encoding): Implemented.
	(all_declarations_processed, manakai_is_html): Implemented.
	(base_uri, manakai_append_text,
	manakai_entity_base_uri, strict_error_checking,
	xml_encoding, xml_version, xml_standalone): Implemented.

	* DOMElement.pm (manakai_base_uri, base_uri): Implemented.
	(get_attribute, get_attribute_node): Alpha version.
	(set_attribute_node, set_attribute_node_ns): Implemented.
	(set_attribute_ns): Accept non-ARRAY qualified name.

	* DOMException.pm (___error_def): |WRONG_DOCUMENT_ERR|,
	|NOT_SUPPORTED_ERR|, and |INUSE_ATTRIBUTE_ERR| are added.

	* DocumentType.pm (public_id, system_id): Implemented.
	(base_uri, declaration_base_uri, manakai_declaration_base_uri,
	manakai_append_text): Implemented.
	(element_types, general_entities, notations,
	set_element_type_definition_node, set_general_entity_node,
	set_notation_node): Alpha version.

	* ElementTypeDefinition.pm (manakai_append_text): Implemented.
	(attribute_definitions, set_attribute_definition_node): Alpha version.

	* Entity.pm (has_replacement_tree, public_id, system_id,
	manakai_declaration_base_uri, manakai_entity_base_uri,
	manakai_entity_uri): Implemented.

	* EntityReference.pm (manakai_expanded, manakai_external): Implemented.
	(base_uri, manakai_entity_base_uri): Implemented.

	* Node.pm (base_uri): Implemented.
	(text_content): Don't check read-only or not
	unless |strict_error_checking|.
	(manakai_append_text): Implemented.
	(get_feature): Alpha.
	(manakai_set_read_only): Implemented.

	* Notation.pm (public_id, system_id, manakai_append_text,
	manakai_declaration_base_uri): Implemented.

	* ProcessingInstruction.pm (manakai_base_uri,
	base_uri, manakai_append_text): Implemented.

1 wakaba 1.1 #!/usr/bin/perl
2     use strict;
3     use Test;
4     BEGIN { plan tests => 29 }
5    
6     require Message::DOM::DOMImplementation;
7     use Message::Util::Error;
8    
9     my $dom = Message::DOM::DOMImplementation->____new;
10     my $doc = $dom->create_document;
11    
12     my $ent = $doc->create_attribute ('attr');
13    
14     {
15     my $prop = 'specified';
16     ok $ent->can ($prop) ? 1 : 0, 1, 'can ' . $prop;
17     ok $ent->$prop ? 1 : 0, 1, $prop . ' test is valid?';
18    
19     for (0, 1, '') {
20     $ent->$prop ($_);
21     ok $ent->$prop ? 1 : 0, 1, $prop . ' ' . $_;
22     }
23    
24     $ent->$prop (undef);
25     ok $ent->$prop ? 1 : 0, 1, $prop . ' undef';
26    
27     my $el = $doc->create_element ('element');
28     $el->set_attribute_node ($ent); # set owner_element
29     ok $ent->$prop ? 1 : 0, 1, $prop . ' test is valid? (has owner_element)';
30    
31     for (0, 1, '') {
32     $ent->$prop ($_);
33     ok $ent->$prop ? 1 : 0, $_ ? 1 : 0, $prop . ' (has owner_element) ' . $_;
34     }
35    
36     $ent->$prop (undef);
37     ok $ent->$prop ? 1 : 0, 0, $prop . ' (has owner_element) undef';
38     }
39    
40     for my $prop (qw/manakai_attribute_type/) {
41     ok $ent->can ($prop) ? 1 : 0, 1, 'can ' . $prop;
42     local $^W = 0;
43    
44     for (-3..10, 'abc', '') {
45     $ent->$prop ($_);
46     ok $ent->$prop, 0+$_, $prop . $_;
47     }
48    
49     $ent->$prop (undef);
50     ok $ent->$prop, 0, $prop . ' undef';
51     }
52    
53     =head1 LICENSE
54    
55     Copyright 2007 Wakaba <w@suika.fam.cx>
56    
57     This program is free software; you can redistribute it and/or
58     modify it under the same terms as Perl itself.
59    
60     =cut
61    
62     ## $Date: 2007/06/16 08:49:00 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24