summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-03-12 18:21:56 +0000
committerNicholas Clark <nick@ccl4.org>2007-03-12 18:21:56 +0000
commit36932700a4dbb6a64cc9d5ed20faca911d716e57 (patch)
tree553f4f6974bb6470c48c9cd59c56215b0810b247 /ext
parent78197f2f0be4032ad7e6a84098d111f4dfcbfbca (diff)
downloadperl-36932700a4dbb6a64cc9d5ed20faca911d716e57.tar.gz
Fix the partially passing TODO test in optree_constants.t by
making the tests for PL_sv_yes and PL_sv_no run as separate programs, rather than code eval'd in the current program, as under ithreads whether you get the real thing or a copy depends on whether any previous code has that SV in a PAD op. p4raw-id: //depot/perl@30553
Diffstat (limited to 'ext')
-rw-r--r--ext/B/t/optree_constants.t56
1 files changed, 29 insertions, 27 deletions
diff --git a/ext/B/t/optree_constants.t b/ext/B/t/optree_constants.t
index ee65540d09..53cdf9f325 100644
--- a/ext/B/t/optree_constants.t
+++ b/ext/B/t/optree_constants.t
@@ -126,43 +126,45 @@ EONT_EONT
checkOptree ( name => 'myyes() as coderef',
- code => 'sub a() { 1==1 }; print a',
+ prog => 'sub a() { 1==1 }; print a',
noanchors => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-# 5 <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->5
-# 1 <;> nextstate(main 810 (eval 47):1) v ->2
-# 4 <@> print sK ->5
-# 2 <0> pushmark s ->3
-# 3 <$> const[SPECIAL sv_yes] s ->4
+# 6 <@> leave[1 ref] vKP/REFC ->(end)
+# 1 <0> enter ->2
+# 2 <;> nextstate(main 2 -e:1) v:{ ->3
+# 5 <@> print vK ->6
+# 3 <0> pushmark s ->4
+# 4 <$> const[SPECIAL sv_yes] s ->5
EOT_EOT
-# 5 <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->5
-# 1 <;> nextstate(main 810 (eval 47):1) v ->2
-# 4 <@> print sK ->5
-# 2 <0> pushmark s ->3
-# 3 <$> const(SPECIAL sv_yes) s ->4
+# 6 <@> leave[1 ref] vKP/REFC ->(end)
+# 1 <0> enter ->2
+# 2 <;> nextstate(main 2 -e:1) v:{ ->3
+# 5 <@> print vK ->6
+# 3 <0> pushmark s ->4
+# 4 <$> const(SPECIAL sv_yes) s ->5
EONT_EONT
+# Need to do this as a prog, not code, as only the first constant to use
+# PL_sv_no actually gets to use the real thing - every one following is
+# copied.
checkOptree ( name => 'myno() as coderef',
- code => 'sub a() { 1!=1 }; print a',
+ prog => 'sub a() { 1!=1 }; print a',
noanchors => 1,
- todo => '- SPECIAL sv_no renders as PVNV 0',
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
-# 5 <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->5
-# 1 <;> nextstate(main 810 (eval 47):1) v ->2
-# 4 <@> print sK ->5
-# 2 <0> pushmark s ->3
-# 3 <$> const[PVNV 0] s ->4
+# 6 <@> leave[1 ref] vKP/REFC ->(end)
+# 1 <0> enter ->2
+# 2 <;> nextstate(main 2 -e:1) v:{ ->3
+# 5 <@> print vK ->6
+# 3 <0> pushmark s ->4
+# 4 <$> const[SPECIAL sv_no] s ->5
EOT_EOT
-# 5 <1> leavesub[1 ref] K/REFC,1 ->(end)
-# - <@> lineseq KP ->5
-# 1 <;> nextstate(main 810 (eval 47):1) v ->2
-# 4 <@> print sK ->5
-# 2 <0> pushmark s ->3
-# 3 <$> const(PVNV 0) s ->4
+# 6 <@> leave[1 ref] vKP/REFC ->(end)
+# 1 <0> enter ->2
+# 2 <;> nextstate(main 2 -e:1) v:{ ->3
+# 5 <@> print vK ->6
+# 3 <0> pushmark s ->4
+# 4 <$> const(SPECIAL sv_no) s ->5
EONT_EONT