summaryrefslogtreecommitdiff
path: root/ext/Devel
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-07-12 07:12:37 +0000
committerNicholas Clark <nick@ccl4.org>2008-07-12 07:12:37 +0000
commitbfe27a58755fd70d150ce6080e7cfdd2f87f2358 (patch)
treeeac9908fee8172f45c01f859a08211003897a064 /ext/Devel
parent597140e2507da2c997d1552f3225cf983ffb9f17 (diff)
downloadperl-bfe27a58755fd70d150ce6080e7cfdd2f87f2358.tar.gz
Test that formats can be dumped.
p4raw-id: //depot/perl@34132
Diffstat (limited to 'ext/Devel')
-rw-r--r--ext/Devel/Peek/t/Peek.t41
1 files changed, 40 insertions, 1 deletions
diff --git a/ext/Devel/Peek/t/Peek.t b/ext/Devel/Peek/t/Peek.t
index 7b63c403b4..3cacd1d2f4 100644
--- a/ext/Devel/Peek/t/Peek.t
+++ b/ext/Devel/Peek/t/Peek.t
@@ -14,11 +14,21 @@ BEGIN { require "./test.pl"; }
use Devel::Peek;
-plan(50);
+plan(52);
our $DEBUG = 0;
open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!";
+# If I reference any lexicals in this, I get the entire outer subroutine (or
+# MAIN) dumped too, which isn't really what I want, as it's a lot of faff to
+# maintain that.
+format PIE =
+Pie @<<<<<
+$::type
+Good @>>>>>
+$::mmmm
+.
+
sub do_test {
my $todo = $_[3];
my $repeat_todo = $_[4];
@@ -624,3 +634,32 @@ do_test(25,
SUBPROCESS = 0 # $] < 5.009
TYPE = \'>\'
FLAGS = 0x0');
+
+do_test(26,
+ *PIE{FORMAT},
+'SV = $RV\\($ADDR\\) at $ADDR
+ REFCNT = 1
+ FLAGS = \\(ROK\\)
+ RV = $ADDR
+ SV = PVFM\\($ADDR\\) at $ADDR
+ REFCNT = 2
+ FLAGS = \\(\\)
+ IV = 0
+ NV = 0 # $] < 5.009
+ PV = 0 # $] >= 5.011
+ COMP_STASH = 0x0
+ START = $ADDR ===> \\d+
+ ROOT = $ADDR
+ XSUB = 0x0 # $] < 5.009
+ XSUBANY = 0 # $] < 5.009
+ GVGV::GV = $ADDR\\t"main" :: "PIE"
+ FILE = ".*\\b(?i:peek\\.t)"
+ DEPTH = 0
+(?: MUTEXP = $ADDR
+ OWNER = $ADDR
+)? FLAGS = 0x0
+ OUTSIDE_SEQ = \\d+
+ LINES = 0
+ PADLIST = $ADDR
+ PADNAME = $ADDR\\($ADDR\\) PAD = $ADDR\\($ADDR\\)
+ OUTSIDE = $ADDR \\(MAIN\\)');