Mercurial > pub > Impl
comparison _test/Test/DOM/Node.pm @ 14:65a7bb156fb7
Дом модель и схема
| author | Sergey |
|---|---|
| date | Fri, 04 Sep 2009 16:38:15 +0400 |
| parents | |
| children | 818c74b038ae |
comparison
equal
deleted
inserted
replaced
| 13:bb8d67f811ea | 14:65a7bb156fb7 |
|---|---|
| 1 package Test::DOM::Node; | |
| 2 use strict; | |
| 3 use warnings; | |
| 4 | |
| 5 use base qw(IMPL::Test::Unit); | |
| 6 use IMPL::Test qw(test shared failed); | |
| 7 use IMPL::Class::Property; | |
| 8 | |
| 9 require IMPL::DOM::Node; | |
| 10 | |
| 11 __PACKAGE__->PassThroughArgs; | |
| 12 | |
| 13 BEGIN { | |
| 14 shared public property Root => prop_all; | |
| 15 } | |
| 16 | |
| 17 test Create => sub { | |
| 18 my ($this) = @_; | |
| 19 | |
| 20 $this->Root(new IMPL::DOM::Node(nodeName => 'Root')) or failed "Failed to create a node"; | |
| 21 }; | |
| 22 | |
| 23 test AppendNode => sub { | |
| 24 my ($this) = @_; | |
| 25 | |
| 26 my $child = $this->Root->appendNode(new IMPL::DOM::Node(nodeName => 'Child')) or failed "Failed to append a child node"; | |
| 27 | |
| 28 my $firstChild = $this->Root->firstChild; | |
| 29 | |
| 30 failed "firstChild returned incorrect results" unless $firstChild == $child; | |
| 31 }; | |
| 32 | |
| 33 1; |
