From: Yitzchak Scott-Thoennes Date: Thu, 26 Sep 2002 22:16:39 +0000 (-0700) Subject: Devel::Peek tests from: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=993318545d74a9d06ae4a37be84d1b19882b129d;p=p5sagit%2Fp5-mst-13.2.git Devel::Peek tests from: Subject: [PATCH] MGf_TAINTEDDIR and MGf_MINMATCH reuse unknown to dump.c Message-ID: <3m+k9gzkgqnP092yn@efn.org> p4raw-id: //depot/perl@17956 --- diff --git a/ext/Devel/Peek/Peek.t b/ext/Devel/Peek/Peek.t index 5b5d738..1d51ce5 100644 --- a/ext/Devel/Peek/Peek.t +++ b/ext/Devel/Peek/Peek.t @@ -1,4 +1,4 @@ -#!./perl +#!./perl -T BEGIN { chdir 't' if -d 't'; @@ -12,7 +12,7 @@ BEGIN { use Devel::Peek; -print "1..19\n"; +print "1..21\n"; our $DEBUG = 0; open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!"; @@ -31,7 +31,7 @@ sub do_test { print $pattern, "\n" if $DEBUG; my $dump = ; print $dump, "\n" if $DEBUG; - print "[$dump] vs [$pattern]\nnot " unless $dump =~ /$pattern/ms; + print "[$dump] vs [$pattern]\nnot " unless $dump =~ /\A$pattern\Z/ms; print "ok $_[0]\n"; close(IN); return $1; @@ -394,6 +394,45 @@ do_test(19, LEN = \\d+'); } +my $x=""; +$x=~/.??/g; +do_test(20, + $x, +'SV = PVMG\\($ADDR\\) at $ADDR + REFCNT = 1 + FLAGS = \\(PADBUSY,PADMY,SMG,POK,pPOK\\) + IV = 0 + NV = 0 + PV = $ADDR ""\\\0 + CUR = 0 + LEN = 1 + MAGIC = $ADDR + MG_VIRTUAL = &PL_vtbl_mglob + MG_TYPE = PERL_MAGIC_regex_global\\(g\\) + MG_FLAGS = 0x01 + MINMATCH'); + +do_test(21, + $ENV{PATH}=@ARGV, # scalar(@ARGV) is a handy known tainted value +'SV = PVMG\\($ADDR\\) at $ADDR + REFCNT = 1 + FLAGS = \\(GMG,SMG,RMG,pIOK,pPOK\\) + IV = 0 + NV = 0 + PV = $ADDR "0"\\\0 + CUR = 1 + LEN = \d+ + MAGIC = $ADDR + MG_VIRTUAL = &PL_vtbl_envelem + MG_TYPE = PERL_MAGIC_envelem\\(e\\) + MG_FLAGS = 0x01 + TAINTEDDIR + MG_LEN = 4 + MG_PTR = $ADDR "PATH" + MAGIC = $ADDR + MG_VIRTUAL = &PL_vtbl_taint + MG_TYPE = PERL_MAGIC_taint\\(t\\)'); + END { 1 while unlink("peek$$"); }