Change 17748 by [EMAIL PROTECTED] on 2002/08/22 00:54:03
todo test for linux $0 modification
Subject: Re: [perl #16206] $0 in 5.8
From: Slaven Rezic <[EMAIL PROTECTED]>
Date: 17 Aug 2002 21:32:37 +0200
Message-id: <[EMAIL PROTECTED]>
Affected files ...
.... //depot/perl/t/op/magic.t#53 edit
Differences ...
==== //depot/perl/t/op/magic.t#53 (xtext) ====
Index: perl/t/op/magic.t
--- perl/t/op/magic.t#52~17473~ Wed Jul 10 16:20:10 2002
+++ perl/t/op/magic.t Wed Aug 21 17:54:03 2002
@@ -20,7 +20,7 @@
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 @@
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 $^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 @@
# -- 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");
+ }
}
{
End of Patch.