summaryrefslogtreecommitdiff
path: root/t/01-basic.t
diff options
context:
space:
mode:
Diffstat (limited to 't/01-basic.t')
-rw-r--r--t/01-basic.t12
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)];