This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Peek.t: Test that DeadCode doesn’t crash
authorFather Chrysostomos <sprout@cpan.org>
Wed, 22 Aug 2012 19:52:15 +0000 (12:52 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 22 Aug 2012 19:54:33 +0000 (12:54 -0700)
I broke it, but Karl Williamson’s commit (the previous) with my tweaks
fixes it.  This function was not at all exercised by the test suite.

ext/Devel-Peek/t/Peek.t

index f641982..5a8efe3 100644 (file)
@@ -922,4 +922,12 @@ unless ($Config{useithreads}) {
 
 # (One block of study tests removed when study was made a no-op.)
 
+{
+    open(OUT,">peek$$") or die "Failed to open peek $$: $!";
+    open(STDERR, ">&OUT") or die "Can't dup OUT: $!";
+    DeadCode();
+    open(STDERR, ">&SAVERR") or die "Can't restore STDERR: $!";
+    pass "no crash with DeadCode";
+}
+
 done_testing();