From: Gurusamy Sarathy Date: Sun, 5 Aug 2001 21:57:43 +0000 (+0000) Subject: remove hardcoded cmd shell in testsuite X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d0cc0d743fcf15e2f42426a114c8bb442562080;p=p5sagit%2Fp5-mst-13.2.git remove hardcoded cmd shell in testsuite p4raw-id: //depot/perl@11590 --- diff --git a/t/op/glob.t b/t/op/glob.t index 2eb371a..bf96e5b 100755 --- a/t/op/glob.t +++ b/t/op/glob.t @@ -11,7 +11,7 @@ print "1..10\n"; if ($^O eq 'MSWin32') { map { $files{lc($_)}++ } ; - map { delete $files{"op/$_"} } split /[\s\n]/, `cmd /c "dir /b /l op & dir /b /l /ah op 2>nul"`, + map { delete $files{"op/$_"} } split /[\s\n]/, `dir /b /l op & dir /b /l /ah op 2>nul`, } else { map { $files{$_}++ } ; diff --git a/t/op/magic.t b/t/op/magic.t index aa568a7..a847ca8 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -32,7 +32,7 @@ $PERL = ($Is_MSWin32 ? '.\perl' : ($Is_NetWare ? 'perl' : './perl')); print "1..41\n"; eval '$ENV{"FOO"} = "hi there";'; # check that ENV is inited inside eval -if ($Is_MSWin32) { ok 1, `cmd /x /c set FOO` eq "FOO=hi there\n"; } +if ($Is_MSWin32) { ok 1, `set FOO` eq "FOO=hi there\n"; } else { ok 1, `echo \$FOO` eq "hi there\n"; } unlink 'ajslkdfpqjsjfk'; @@ -196,12 +196,12 @@ else { %ENV = (); $ENV{PATH} = $PATH; $ENV{PERL_DESTRUCT_LEVEL} = $PDL || 0; - ok 29, ($Is_MSWin32 ? (`cmd /x /c set foo 2>NUL` eq "") + ok 29, ($Is_MSWin32 ? (`set foo 2>NUL` eq "") : (`echo \$foo` eq "\n") ); $ENV{__NoNeSuCh} = "foo"; $0 = "bar"; - ok 30, ($Is_MSWin32 ? (`cmd /x /c set __NoNeSuCh` eq "__NoNeSuCh=foo\n") + ok 30, ($Is_MSWin32 ? (`set __NoNeSuCh` eq "__NoNeSuCh=foo\n") : (`echo \$__NoNeSuCh` eq "foo\n") ); } diff --git a/t/op/stat.t b/t/op/stat.t index 20dbd90..088c221 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -93,13 +93,13 @@ else { `touch Op.stat.tmp` } if (-z 'Op.stat.tmp') {print "ok 5\n";} else {print "not ok 5\n";} if (! -s 'Op.stat.tmp') {print "ok 6\n";} else {print "not ok 6\n";} -$Is_MSWin32 ? `cmd /c echo hi > Op.stat.tmp` : `echo hi >Op.stat.tmp`; +`echo hi >Op.stat.tmp`; if (! -z 'Op.stat.tmp') {print "ok 7\n";} else {print "not ok 7\n";} if (-s 'Op.stat.tmp') {print "ok 8\n";} else {print "not ok 8\n";} unlink 'Op.stat.tmp' or print "# unlink failed: $!\n"; $olduid = $>; # can't test -r if uid == 0 -$Is_MSWin32 ? `cmd /c echo hi > Op.stat.tmp` : `echo hi >Op.stat.tmp`; +`echo hi >Op.stat.tmp`; chmod 0,'Op.stat.tmp'; eval '$> = 1;'; # so switch uid (may not be implemented) if (!$> || $Is_Dos || $Is_Cygwin || ! -r 'Op.stat.tmp') {print "ok 9\n";} else {print "not ok 9\n";}