Fix Peek.t to work with and without DEBUG_LEAKING_SCALARS
Rafael Garcia-Suarez [Tue, 29 Mar 2005 07:01:40 +0000 (07:01 +0000)]
p4raw-id: //depot/perl@24091

ext/Devel/Peek/t/Peek.t

index ac57026..7c932d0 100644 (file)
@@ -29,7 +29,7 @@ sub do_test {
            $pattern =~ s/\$ADDR/0x[[:xdigit:]]+/g;
            $pattern =~ s/\$FLOAT/(?:\\d*\\.\\d+(?:e[-+]\\d+)?|\\d+)/g;
            # handle DEBUG_LEAKING_SCALARS prefix
-           $pattern =~ s/^(\s*)(SV =.* at )/$1ALLOCATED at .*?\n$1$2/mg;
+           $pattern =~ s/^(\s*)(SV =.* at )/(?:$1ALLOCATED at .*?\n)?$1$2/mg;
            print $pattern, "\n" if $DEBUG;
            my $dump = <IN>;
            print $dump, "\n"    if $DEBUG;