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