diff --git a/t/lib/PPI/Test.pm b/t/lib/PPI/Test.pm index 5d5f9ac2..f1acec1e 100644 --- a/t/lib/PPI/Test.pm +++ b/t/lib/PPI/Test.pm @@ -5,7 +5,7 @@ use strict; use vars qw{$VERSION @ISA @EXPORT_OK %EXPORT_TAGS}; BEGIN { - $VERSION = '1.216_01'; + $VERSION = '1.220'; @ISA = 'Exporter'; %EXPORT_TAGS = ( 'cmp' => [ qw( @@ -40,47 +40,46 @@ elements one by one against C, failing the test if the two do not compare correctly. The variant C ignores insignificant elements in the -document so that you omit them from C. +document so that you can omit them from C. -The contents of C dictate how the comparison is done. -Each element of C is a hashref that describes how to +Each element of C is a hashref whose keys describe how to compare it to the corresponding element from the parse. +Hash keys supported: =over 4 -=item class: +=item class The value of C is compared to the parsed element's class. -=item isa: +=item isa The value of C is passed to an isa call on parsed element. =item name of any method on the parsed PPI element: -Any hash key not otherwise document is used as a method name on the parsed -element being compared, and the results must match the hash key's value. -If the element being compared does not have that method, the test +Any hash key not otherwise documented is used as a method name on the +parsed element; the results of the method call must match the hash key's +value. If the element being compared does not have that method, the test will fail. -=item FUNC: +=item FUNC The value for this attribute is a sub that accepts the parsed element -as its argument. Execute as many tests on anything you like in the -sub. E.g.: +as its argument, along with a test description. Execute as many tests +on anything you like in the sub. E.g.: FUNC => sub { - my ( $elem, $msg ) = @_; - is_deeply( [$elem->foo()], [1, 2, 3], "$msg: testing foo" ); + my ( $elem, $msg ) = @_; + is_deeply( [$elem->foo()], [1, 2, 3], "$msg: testing foo" ); } The return value of the sub is ignored. -=item STOP: +=item STOP -When the key STOP appears with a true value in a hash in C, -comparison stops after that hash has been compared. Test success or -failure is the result of that last comparison. +When the key STOP appears with a true value in C, +comparison stops after that hash has been compared. =back @@ -216,7 +215,7 @@ you don't have to have a C element at the beginning of C. The variant C ignores insignificant elements in the -document so that you omit them from C. +document so that you can omit them from C. C can be passed as a hashref if you have only one element to compare. @@ -276,7 +275,7 @@ You can also pass a listref of hashes for C, in which case all elements in C must match. The variant C ignores insignificant elements in the -document so that you omit them from C. +document so that you can omit them from C. The return is true for a successful test, false otherwise.