From 74cfb115ac810480c0000dc742b20383c1578bac Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 27 Oct 2002 22:15:15 +0000 Subject: stock perl 5.8.0 from CPAN --- gnu/usr.bin/perl/lib/Shell.t | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 gnu/usr.bin/perl/lib/Shell.t (limited to 'gnu/usr.bin/perl/lib/Shell.t') 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") ; -- cgit v1.2.3