Commit | Line | Data |
e66df073 |
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 | { |
72c157b0 |
39 | ok(directory(),'Execute command'); |
40 | my @files = directory('*.*'); |
41 | ok(@files,'Quoted arguments'); |
e66df073 |
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 | } |
9fb80172 |
60 | open(STDERR,">&SAVERR") ; |