Mercurial > pub > Impl
diff _test/Test/DOM/Node.pm @ 14:65a7bb156fb7
Дом модель и схема
author | Sergey |
---|---|
date | Fri, 04 Sep 2009 16:38:15 +0400 |
parents | |
children | 818c74b038ae |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/_test/Test/DOM/Node.pm Fri Sep 04 16:38:15 2009 +0400 @@ -0,0 +1,33 @@ +package Test::DOM::Node; +use strict; +use warnings; + +use base qw(IMPL::Test::Unit); +use IMPL::Test qw(test shared failed); +use IMPL::Class::Property; + +require IMPL::DOM::Node; + +__PACKAGE__->PassThroughArgs; + +BEGIN { + shared public property Root => prop_all; +} + +test Create => sub { + my ($this) = @_; + + $this->Root(new IMPL::DOM::Node(nodeName => 'Root')) or failed "Failed to create a node"; +}; + +test AppendNode => sub { + my ($this) = @_; + + my $child = $this->Root->appendNode(new IMPL::DOM::Node(nodeName => 'Child')) or failed "Failed to append a child node"; + + my $firstChild = $this->Root->firstChild; + + failed "firstChild returned incorrect results" unless $firstChild == $child; +}; + +1;