This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make Peek.t less sensitive to NO_COW config args
authorFather Chrysostomos <sprout@cpan.org>
Tue, 4 Nov 2014 22:40:22 +0000 (14:40 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 4 Nov 2014 22:40:44 +0000 (14:40 -0800)
Maybe what I am doing is too clever, but I just take the last Configure
command line and add an S to -DPERL_NO_COW to disable it.  It doesn’t
hurt to make Peek.t more robust, though.

ext/Devel-Peek/t/Peek.t

index 0a4c637..51aa816 100644 (file)
@@ -90,7 +90,7 @@ sub do_test {
            /mge;
            $pattern =~ s/^\h+COW_REFCNT = .*\n//mg
                if $Config{ccflags} =~
-                       /-DPERL_(?:OLD_COPY_ON_WRITE|NO_COW)/
+                       /-DPERL_(?:OLD_COPY_ON_WRITE|NO_COW)\b/
                            || $] < 5.019003;
            print $pattern, "\n" if $DEBUG;
            my ($dump, $dump2) = split m/\*\*\*\*\*\n/, scalar <IN>;
@@ -185,7 +185,7 @@ my $type = do_test('result of addition',
 do_test('floating point value',
        $d,
        $] < 5.019003
-        || $Config{ccflags} =~ /-DPERL_(?:NO_COW|OLD_COPY_ON_WRITE)/
+        || $Config{ccflags} =~ /-DPERL_(?:NO_COW|OLD_COPY_ON_WRITE)\b/
        ?
 'SV = PVNV\\($ADDR\\) at $ADDR
   REFCNT = 1