summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-23 21:18:51 +0100
committerNicholas Clark <nick@ccl4.org>2011-06-11 09:32:41 +0200
commitccbcbb3d6584c01ff4c18f0e39e86d6eb181eb4d (patch)
treec7a74b510c31da62941a0e37664bd1457087cd70 /ext
parent0a0c4b76b41cff6aaa3670fa19292a3e9248e69e (diff)
downloadperl-ccbcbb3d6584c01ff4c18f0e39e86d6eb181eb4d.tar.gz
Test dumping studied scalars.
Diffstat (limited to 'ext')
-rw-r--r--ext/Devel-Peek/t/Peek.t30
1 files changed, 29 insertions, 1 deletions
diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t
index 4fee5e72b6..ec54405c6d 100644
--- a/ext/Devel-Peek/t/Peek.t
+++ b/ext/Devel-Peek/t/Peek.t
@@ -778,7 +778,10 @@ SKIP: {
or diag $@;
}
-use constant perl => 'rules';
+use constant {
+ perl => 'rules',
+ beer => 'foamy',
+};
unless ($Config{useithreads}) {
# These end up as copies in pads under ithreads, which rather defeats the
@@ -814,6 +817,31 @@ unless ($Config{useithreads}) {
PREVIOUS = 1
USEFUL = 100
');
+
+ do_test('regular string constant', beer,
+'SV = PV\\($ADDR\\) at $ADDR
+ REFCNT = 4
+ FLAGS = \\(PADMY,POK,READONLY,pPOK\\)
+ PV = $ADDR "foamy"\\\0
+ CUR = 5
+ LEN = \d+
+');
+
+ is(study beer, 1, "Our studies were successful");
+
+ do_test('string constant now studied', beer,
+'SV = PVMG\\($ADDR\\) at $ADDR
+ REFCNT = 5
+ FLAGS = \\(PADMY,SMG,POK,READONLY,pPOK,SCREAM\\)
+ IV = 0
+ NV = 0
+ PV = $ADDR "foamy"\\\0
+ CUR = 5
+ LEN = \d+
+ MAGIC = $ADDR
+ MG_VIRTUAL = &PL_vtbl_mglob
+ MG_TYPE = PERL_MAGIC_regex_global\\(g\\)
+');
}
done_testing();