This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Typos and nits in pods
[perl5.git] / t / comp / retainedlines.t
index 8de8237..9a2a192 100644 (file)
@@ -6,7 +6,7 @@
 # we've not yet verified that use works.
 # use strict;
 
-print "1..65\n";
+print "1..72\n";
 my $test = 0;
 
 sub failed {
@@ -131,3 +131,20 @@ foreach my $flags (0x0, 0x800, 0x1000, 0x1800) {
            "evals that fail are correctly cleaned up");
     }
 }
+
+# BEGIN blocks that die
+for (0xA, 0) {
+  local $^P = $_;
+
+  eval (my $prog = "BEGIN{die}\n");
+
+  if ($_) {
+    check_retained_lines($prog, 'eval that defines BEGIN that dies');
+  }
+  else {
+    my @after = grep { /eval/ } keys %::;
+
+    is (scalar @after, 0 + keys %seen,
+       "evals with BEGIN{die} are correctly cleaned up");
+  }
+}