-#!./perl
+#!./perl -T
BEGIN {
chdir 't' if -d 't';
use Devel::Peek;
-print "1..19\n";
+print "1..21\n";
our $DEBUG = 0;
open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!";
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;
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$$");
}