diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-10-27 22:15:15 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-10-27 22:15:15 +0000 |
commit | 74cfb115ac810480c0000dc742b20383c1578bac (patch) | |
tree | 316d96e5123617976f1637b143570c309a662045 /gnu/usr.bin/perl/lib/Shell.t | |
parent | 453ade492b8e06c619009d6cd52a85cb04e8cf17 (diff) |
stock perl 5.8.0 from CPAN
Diffstat (limited to 'gnu/usr.bin/perl/lib/Shell.t')
-rw-r--r-- | gnu/usr.bin/perl/lib/Shell.t | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/lib/Shell.t b/gnu/usr.bin/perl/lib/Shell.t new file mode 100644 index 00000000000..b2d3d67aa05 --- /dev/null +++ b/gnu/usr.bin/perl/lib/Shell.t @@ -0,0 +1,66 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use Test::More tests => 4; + +BEGIN { use_ok('Shell'); } + +my $Is_VMS = $^O eq 'VMS'; +my $Is_MSWin32 = $^O eq 'MSWin32'; +my $Is_NetWare = $^O eq 'NetWare'; + +$Shell::capture_stderr = 1; # + +# Now test that that works .. + +my $tmpfile = 'sht0001'; + +while ( -f $tmpfile ) +{ + $tmpfile++; +} + +END { -f $tmpfile && (open STDERR, '>&SAVERR' and unlink $tmpfile) }; + + + +open(SAVERR,">&STDERR") ; +open(STDERR, ">$tmpfile"); + +xXx(); # Ok someone could have a program called this :( + +# On os2 the warning is on by default... +ok( ($^O eq 'os2' xor !(-s $tmpfile)) ,'$Shell::capture_stderr'); + +$Shell::capture_stderr = 0; # + +# someone will have to fill in the blanks for other platforms + +if ( $Is_VMS ) +{ + ok(directory(),'Execute command'); + my @files = directory('*.*'); + ok(@files,'Quoted arguments'); +} +elsif( $Is_MSWin32 ) +{ + ok(dir(),'Execute command'); + + my @files = dir('*.*'); + + ok(@files, 'Quoted arguments'); +} +else +{ + ok(ls(),'Execute command'); + + my @files = ls('*'); + + ok(@files,'Quoted arguments'); + +} +open(STDERR,">&SAVERR") ; |