diff options
author | Gianni Ceccarelli <dakkar@dechirico.(none)> | 2009-03-17 17:46:40 +0100 |
---|---|---|
committer | Gianni Ceccarelli <dakkar@dechirico.(none)> | 2009-03-17 17:46:40 +0100 |
commit | 3a65eeb9b614e7fa4b683db6a98ca0026b5a2404 (patch) | |
tree | 4fb78434fc3eab36cc4b9c181791b752e8f07000 /t | |
parent | some functions (diff) | |
download | Tree-Transform-XSLTish-3a65eeb9b614e7fa4b683db6a98ca0026b5a2404.tar.gz Tree-Transform-XSLTish-3a65eeb9b614e7fa4b683db6a98ca0026b5a2404.tar.bz2 Tree-Transform-XSLTish-3a65eeb9b614e7fa4b683db6a98ca0026b5a2404.zip |
passes the first test!
Diffstat (limited to 't')
-rw-r--r-- | t/01-basic.t | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/t/01-basic.t b/t/01-basic.t index e9b285b..a6eb0ba 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -9,7 +9,7 @@ package BasicTransform;{ }; tree_rule match => '*', action => sub { - return $_[0]->it->name; + return $_[0]->it->name, $_[0]->apply_rules; } } @@ -20,11 +20,17 @@ use strict; use warnings; use Tree::DAG_Node::XPath; +sub Tree::DAG_Node::XPath::Root::xpath_get_root_node { return $_[0] } + my $tree=Tree::DAG_Node::XPath->new(); +$tree->name('base'); $tree->new_daughter->name("coso$_") for 1..5; my $trans=BasicTransform->new(); -my @results=$trans->apply_rules($tree); +#explain 'root children:',$tree->xpath_get_root_node->xpath_get_child_nodes; +#explain 'root children:',$trans->engine->findnodes('*',$tree); + +my @results=$trans->transform($tree); -is_deeply \@results,[qw(root coso1 coso2 coso3 coso4 coso5)]; +is_deeply \@results,[qw(root base coso1 coso2 coso3 coso4 coso5)]; |