Commit | Line | Data |
---|---|---|
e66df073 JS |
1 | #!./perl |
2 | ||
3 | use Test::More tests => 4; | |
4 | ||
5 | BEGIN { use_ok('Shell'); } | |
6 | ||
7 | my $Is_VMS = $^O eq 'VMS'; | |
8 | my $Is_MSWin32 = $^O eq 'MSWin32'; | |
9 | my $Is_NetWare = $^O eq 'NetWare'; | |
10 | ||
11 | $Shell::capture_stderr = 1; # | |
12 | ||
13 | # Now test that that works .. | |
14 | ||
15 | my $tmpfile = 'sht0001'; | |
16 | ||
17 | while ( -f $tmpfile ) | |
18 | { | |
19 | $tmpfile++; | |
20 | } | |
21 | ||
22 | END { -f $tmpfile && unlink $tmpfile }; | |
23 | ||
24 | ||
25 | ||
26 | open(SAVERR,">&STDERR") ; | |
27 | open(STDERR, ">$tmpfile"); | |
28 | ||
29 | xXx(); # Ok someone could have a program called this :( | |
30 | ||
31 | ok( !(-s $tmpfile) ,'$Shell::capture_stderr'); | |
32 | ||
33 | $Shell::capture_stderr = 0; # | |
34 | ||
35 | # someone will have to fill in the blanks for other platforms | |
36 | ||
37 | if ( $Is_VMS ) | |
38 | { | |
39 | skip "Please implement VMS test", 2; | |
40 | ok(1); | |
41 | ok(1); | |
42 | } | |
43 | elsif( $Is_MSWin32 ) | |
44 | { | |
45 | ok(dir(),'Execute command'); | |
46 | ||
47 | my @files = dir('*.*'); | |
48 | ||
49 | ok(@files, 'Quoted arguments'); | |
50 | } | |
51 | else | |
52 | { | |
53 | ok(ls(),'Execute command'); | |
54 | ||
55 | my @files = ls('*'); | |
56 | ||
57 | ok(@files,'Quoted arguments'); | |
58 | ||
59 | } |