Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Todo test framework for testing destroy problem

  • Loading branch information...
commit 6623349bda3830b78c2565c3ab3e26de11681d7e 1 parent a5d8de5
@ashb authored
Showing with 46 additions and 0 deletions.
  1. +46 −0 t/destroy.t
View
46 t/destroy.t
@@ -0,0 +1,46 @@
+use strict;
+use warnings;
+
+use Test::More;
+use TryCatch;
+
+{
+ package ROBOT;
+ sub DESTROY {
+ # Something that does it 'wrong' and stomps on $@
+ eval {};
+ }
+}
+
+sub test {
+ my ($create_object) = @_;
+ try {
+ try {
+ my $obj;
+
+ $obj = bless {}, "ROBOT" if ($create_object);
+ eval {
+ die "IN EVAL";
+ };
+ local $SIG{__DIE__} = sub { print "old die handler\n"};
+
+ die "ERROR";
+ }
+ catch ($e) {
+ print "caught error '$e'\n";
+ return;
+ }
+ }
+ catch ($e) {
+ return $e;
+ }
+ print "caught nothing\n";
+}
+
+test();
+test(1);
+
+local $TODO = "work out what this needs to test";
+fail;
+
+done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.