diff options
author | dakkar <dakkar@sardina.(none)> | 2009-06-28 11:32:29 +0200 |
---|---|---|
committer | dakkar <dakkar@sardina.(none)> | 2009-06-28 11:32:29 +0200 |
commit | 1c0c8c25c5808b97d58a6fc0a887ba63bd35ee8c (patch) | |
tree | baa9315a39859381df230b78b817c18d394eace9 /t | |
parent | prossibly better node equality test (diff) | |
parent | rename, since we're not actually using Class::XPath (diff) | |
download | Tree-Transform-XSLTish-1c0c8c25c5808b97d58a6fc0a887ba63bd35ee8c.tar.gz Tree-Transform-XSLTish-1c0c8c25c5808b97d58a6fc0a887ba63bd35ee8c.tar.bz2 Tree-Transform-XSLTish-1c0c8c25c5808b97d58a6fc0a887ba63bd35ee8c.zip |
Merge branch 'class-xpath'
Diffstat (limited to 't')
-rw-r--r-- | t/07-ppix-class.t | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/t/07-ppix-class.t b/t/07-ppix-class.t new file mode 100644 index 0000000..7702993 --- /dev/null +++ b/t/07-ppix-class.t @@ -0,0 +1,41 @@ +#!perl +package main; +use Test::Most 'die'; +BEGIN { + eval 'use PPIx::XPath 2.00'; + plan skip_all => 'PPIx::XPath 2.00 needed for this test' if $@; +} + +package PPITransform;{ + use Tree::Transform::XSLTish; + use strict; + use warnings; + + default_rules; + + tree_rule match => 'Statement-Sub', action => sub { + return $_[0]->it->name.$_[0]->it->prototype; + }; + +} + +package main; +use strict; +use warnings; +use PPI; + +plan tests=>1; + +{ +my $doc=PPI::Document->new(\<<'EOP'); +sub gino($%) {} +sub pino {} + +gino(\&pino,{1=>2}); +EOP + +my $trans=PPITransform->new(); + +my @results=$trans->transform($doc); +is_deeply \@results,['gino($%)','pino'],'PPI example'; +} |