From: Nicholas Clark Date: Sat, 12 Jul 2008 07:12:37 +0000 (+0000) Subject: Test that formats can be dumped. X-Git-Tag: accepted/trunk/20130322.191538~12939 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfe27a58755fd70d150ce6080e7cfdd2f87f2358;p=platform%2Fupstream%2Fperl.git Test that formats can be dumped. p4raw-id: //depot/perl@34132 --- diff --git a/ext/Devel/Peek/t/Peek.t b/ext/Devel/Peek/t/Peek.t index 7b63c40..3cacd1d 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\\)');