| 1 | # pmfunc testing |
| 2 | |
| 3 | # ------ pragmas |
| 4 | use strictscip-perl cpan pmtools 2.2.0 strict/; |
| 5 | use warningsscip-perl cpan pmtools 2.2.0 warnings/; |
| 6 | use Test::Morescip-perl cpan pmtools 2.2.0 Test/More/ tests => 3; |
| 7 | |
| 8 | # ------ define variable |
| 9 | my $output = undef; # output from pmfunc |
| 10 | |
| 11 | # ------ add pmtools to PATH for testing, so we use the current pmtools |
| 12 | $ENVscip-perl cpan pmtools 2.2.0 main/`%ENV`.{"PATH"} = 'blib/script:' . $ENVscip-perl cpan pmtools 2.2.0 main/`%ENV`.{"PATH"}; |
| 13 | |
| 14 | eval { |
| 15 | $output = `bin/pmfunc Cwd::chdir 2>&1`; |
| 16 | }; |
| 17 | |
| 18 | isntscip-perl cpan pmtools 2.2.0 main/isnt().($?scip-perl cpan pmtools 2.2.0 main/`$?`., 127, "pmfunc runs"); |
| 19 | |
| 20 | likescip-perl cpan pmtools 2.2.0 main/like().($output, qr/^sub\schdir\s/msx, "found 'chdir()'"); |
| 21 | likescip-perl cpan pmtools 2.2.0 main/like().($output, qr/my\s\$newdir\s=\s/msx, "display function body"); |