Commit 32a0339495c9183a13c69fdaa944bf1de145fbb3
- Diff rendering mode:
- inline
- side by side
t/02-glue.t
(11 / 1)
|   | |||
| 15 | 15 | } | |
| 16 | 16 | ||
| 17 | 17 | sub run_tests () { | |
| 18 | plan(17); | ||
| 18 | plan(20); | ||
| 19 | 19 | ||
| 20 | 20 | test_subst(); | |
| 21 | 21 | test_join(); | |
| 22 | 22 | test_split(); | |
| 23 | 23 | test_path_exists(); | |
| 24 | test_qx(); | ||
| 24 | 25 | } | |
| 25 | 26 | ||
| 27 | sub test_qx() { | ||
| 28 | my $cmd := '/bin/true'; | ||
| 29 | my $output := qx($cmd); | ||
| 30 | nok(qx(''),'qx() on the empty string returns false'); | ||
| 31 | |||
| 32 | $output := qx('IHOPETHATTHISPATHDOESNOTEXISTANDISEXECUTABLEANDRETURNSTRUE'); | ||
| 33 | like($output, ':s command not found','qx() on invalid path returns false'); | ||
| 34 | ok($output, 'qx() on /bin/true returns a truthy value'); | ||
| 35 | } | ||
| 26 | 36 | sub test_path_exists() { | |
| 27 | 37 | ok( path_exists('.'), 'path_exists finds .'); | |
| 28 | 38 | nok(path_exists('DOESNOTEXIST'), 'path_exists returns false for nonexistent files'); |

