diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2002-09-26 15:16:39 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-10-02 13:51:12 +0000 |
commit | 993318545d74a9d06ae4a37be84d1b19882b129d (patch) | |
tree | 5b828e9919562e468aaf3a35c7f4adba7f7e209f /ext/Devel/Peek | |
parent | 2cdc098b0ca3aa6472d96981cd6e2bbef5e34f6a (diff) | |
download | perl-993318545d74a9d06ae4a37be84d1b19882b129d.tar.gz |
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
Diffstat (limited to 'ext/Devel/Peek')
-rw-r--r-- | ext/Devel/Peek/Peek.t | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/ext/Devel/Peek/Peek.t b/ext/Devel/Peek/Peek.t index 5b5d738d66..1d51ce5d4f 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 = <IN>; 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$$"); } |