This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B::Concise was failing to traverse some children of PMOPs
[perl5.git] / ext / B / t / optree_misc.t
index 7a8f25a..c5d4e2e 100644 (file)
@@ -10,7 +10,7 @@ BEGIN {
 }
 use OptreeCheck;
 use Config;
-plan tests => 2;
+plan tests => 3;
 
 SKIP: {
 skip "no perlio in this build", 1 unless $Config::Config{useperlio};
@@ -98,5 +98,29 @@ checkOptree ( name      => 'index and PVBM',
              strip_open_hints => 1,
              expect    => $t,  expect_nt => $nt);
 
-__END__
+checkOptree ( name     => 'PMOP children',
+             code      => sub { $foo =~ s/(a)/$1/ },
+             strip_open_hints => 1,
+             expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
+# 6  <1> leavesub[1 ref] K/REFC,1 ->(end)
+# -     <@> lineseq KP ->6
+# 1        <;> nextstate(main 1 -e:1) v:{ ->2
+# 3        </> subst(/"(a)"/ replstart->4) KS ->6
+# -           <1> ex-rv2sv sKRM/1 ->3
+# 2              <#> gvsv[*foo] s ->3
+# 5           <|> substcont(other->3) sK/1 ->(end)
+# -              <1> ex-rv2sv sK/1 ->5
+# 4                 <#> gvsv[*1] s ->5
+EOT_EOT
+# 6  <1> leavesub[1 ref] K/REFC,1 ->(end)
+# -     <@> lineseq KP ->6
+# 1        <;> nextstate(main 1 -e:1) v:{ ->2
+# 3        </> subst(/"(a)"/ replstart->4) KS ->6
+# -           <1> ex-rv2sv sKRM/1 ->3
+# 2              <$> gvsv(*foo) s ->3
+# 5           <|> substcont(other->3) sK/1 ->(end)
+# -              <1> ex-rv2sv sK/1 ->5
+# 4                 <$> gvsv(*1) s ->5
+EONT_EONT
 
+__END__