From bafdd1bf402e0970facd7fdb29438596621dcd52 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 28 Jun 2009 11:32:05 +0200 Subject: rename, since we're not actually using Class::XPath --- t/07-class-xpath.t | 41 ----------------------------------------- t/07-ppix-class.t | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 t/07-class-xpath.t create mode 100644 t/07-ppix-class.t diff --git a/t/07-class-xpath.t b/t/07-class-xpath.t deleted file mode 100644 index 7702993..0000000 --- a/t/07-class-xpath.t +++ /dev/null @@ -1,41 +0,0 @@ -#!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'; -} 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'; +} -- cgit v1.2.3