summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlaven Rezic <slaven@rezic.de>2002-08-17 23:32:37 +0200
committerhv <hv@crypt.org>2002-08-22 00:54:03 +0000
commit09fdc0787582a550005832c52b37e3525e3be08c (patch)
tree473aa7ec778f7c1d3681faaf425772b65684e8e8
parent439cb1c4bca8637a65af6ff559799d9f5b05b394 (diff)
downloadperl-09fdc0787582a550005832c52b37e3525e3be08c.tar.gz
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
-rwxr-xr-xt/op/magic.t15
1 files changed, 12 insertions, 3 deletions
diff --git a/t/op/magic.t b/t/op/magic.t
index 436e253ee2..beed7f5427 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 <CMDLINE>);
+ 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");
+ }
}
{