From: Slaven Rezic Date: Sat, 17 Aug 2002 21:32:37 +0000 (+0200) Subject: todo test for linux $0 modification X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09fdc0787582a550005832c52b37e3525e3be08c;p=p5sagit%2Fp5-mst-13.2.git todo test for linux $0 modification Subject: Re: [perl #16206] $0 in 5.8 Message-id: <87elcx2sdm.fsf@vran.herceg.de> p4raw-id: //depot/perl@17748 --- diff --git a/t/op/magic.t b/t/op/magic.t index 436e253..beed7f5 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -20,7 +20,7 @@ sub ok { unless( $ok ) { printf "# Failed test at line %d\n", (caller)[2]; - print "# $info" if defined $info; + print "# $info\n" if defined $info; } $test++; @@ -36,7 +36,7 @@ sub skip { return 1; } -print "1..46\n"; +print "1..47\n"; $Is_MSWin32 = $^O eq 'MSWin32'; $Is_NetWare = $^O eq 'NetWare'; @@ -235,7 +235,7 @@ ok $^O; ok $^T > 850000000, $^T; if ($Is_VMS || $Is_Dos || $Is_MacOS) { - skip("%ENV manipulations fail or aren't safe on $^O") for 1..2; + skip("%ENV manipulations fail or aren't safe on $^O") for 1..3; } else { $PATH = $ENV{PATH}; @@ -253,6 +253,15 @@ else { # -- Nikola Knezevic ok ($Is_MSWin32 ? (`set __NoNeSuCh` =~ /^(?:__NoNeSuCh=)?foo$/) : (`echo \$__NoNeSuCh` eq "foo\n") ); + if ($^O =~ /^(linux|freebsd)$/ && + open CMDLINE, "/proc/$$/cmdline") { + chomp(my $line = scalar ); + my $me = (split /\0/, $line)[0]; + ok($me eq $0, 'altering $0 is effective', 'PL_origarg{c,v} copy breaks this'); + close CMDLINE; + } else { + skip("\$0 check only on Linux and FreeBSD with /proc"); + } } {