diff options
author | Tom Hukins <tom@eborcom.com> | 2020-12-02 17:26:09 +0000 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-12-05 11:57:24 -0700 |
commit | 4b64ef5938269561fff7dc66b69ce34d1bbc8c36 (patch) | |
tree | a2b208e16b9b8864d8504c7bab8c0209e88696b9 /t/op/magic.t | |
parent | 0cf25474a4e6fde7b750472677d559b7e27f3360 (diff) | |
download | perl-4b64ef5938269561fff7dc66b69ce34d1bbc8c36.tar.gz |
Test setting $0 on Dragonfly BSD
Support for this began in Perl 5.26.0 with commit 38626956885060503.
Diffstat (limited to 't/op/magic.t')
-rw-r--r-- | t/op/magic.t | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/op/magic.t b/t/op/magic.t index 6283df5ac2..3f23648a86 100644 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -797,15 +797,15 @@ SKIP: { env_is(__NoNeLoCaL => ''); SKIP: { - skip("\$0 check only on Linux and FreeBSD", 2) - unless $^O =~ /^(linux|android|freebsd)$/ + skip("\$0 check only on Linux, Dragonfly BSD and FreeBSD", 2) + unless $^O =~ /^(linux|android|dragonfly|freebsd)$/ && open CMDLINE, "/proc/$$/cmdline"; chomp(my $line = scalar <CMDLINE>); my $me = (split /\0/, $line)[0]; is $me, $0, 'altering $0 is effective (testing with /proc/)'; close CMDLINE; - skip("\$0 check with 'ps' only on Linux (but not Android) and FreeBSD", 1) if $^O eq 'android'; + skip("No \$0 check with 'ps' on Android", 1) if $^O eq 'android'; # perlbug #22811 my $mydollarzero = sub { my($arg) = shift; @@ -830,7 +830,7 @@ SKIP: { # FreeBSD cannot get rid of both the leading "perl :" # and the trailing " (perl)": some FreeBSD versions # can get rid of the first one. - || ($^O eq 'freebsd' && $ps =~ m/^(?:perl: )?x(?: \(perl\))?$/), + || ($^O =~ /^(dragonfly|freebsd)$/ && $ps =~ m/^(?:perl: )?x(?: \(perl\))?$/), 'altering $0 is effective (testing with `ps`)'); } } |