File descriptor leak in do_exec3
[p5sagit/p5-mst-13.2.git] / t / op / exec.t
CommitLineData
8d063cd8 1#!./perl
2
8d063cd8 3$| = 1; # flush stdout
68dc0745 4
5if ($^O eq 'MSWin32') {
1d3434b8 6 # XXX the system tests could be written to use ./perl and so work on Win32
45c0de28 7 print "1..0 # Skip: shh, win32\n";
68dc0745 8 exit(0);
9}
10
378cc40b 11print "1..8\n";
8d063cd8 12
ec40c0cd 13if ($^O ne 'os2') {
14 print "not ok 1\n" if system "echo ok \\1"; # shell interpreted
15}
16else {
17 print "ok 1 # skipped: bug/feature of pdksh\n"; # shell interpreted
18}
378cc40b 19print "not ok 2\n" if system "echo ok 2"; # split and directly called
20print "not ok 3\n" if system "echo", "ok", "3"; # directly called
8d063cd8 21
1d3434b8 22# these should probably be rewritten to match the examples in perlfunc.pod
378cc40b 23if (system "true") {print "not ok 4\n";} else {print "ok 4\n";}
24
25if ((system "/bin/sh -c 'exit 1'") != 256) { print "not "; }
26print "ok 5\n";
27
28if ((system "lskdfj") == 255 << 8) {print "ok 6\n";} else {print "not ok 6\n";}
29
30unless (exec "lskdjfalksdjfdjfkls") {print "ok 7\n";} else {print "not ok 7\n";}
31
32exec "echo","ok","8";