Commit 32a0339495c9183a13c69fdaa944bf1de145fbb3

  • avatar
  • Duke Leto <jonathan @le…o.net>
  • Sat Nov 21 03:08:53 CET 2009
[t] Add some tests for qx(). These will probably fail on non-unixy boxen
t/02-glue.t
(11 / 1)
  
1515}
1616
1717sub run_tests () {
18 plan(17);
18 plan(20);
1919
2020 test_subst();
2121 test_join();
2222 test_split();
2323 test_path_exists();
24 test_qx();
2425}
2526
27sub 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}
2636sub test_path_exists() {
2737 ok( path_exists('.'), 'path_exists finds .');
2838 nok(path_exists('DOESNOTEXIST'), 'path_exists returns false for nonexistent files');