]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/lib/Variable/Magic/TestDieRequired.pm
Fix and test segfaults and wrong "Unknown error" exceptions when dieing in require...
[perl/modules/Variable-Magic.git] / t / lib / Variable / Magic / TestDieRequired.pm
diff --git a/t/lib/Variable/Magic/TestDieRequired.pm b/t/lib/Variable/Magic/TestDieRequired.pm
new file mode 100644 (file)
index 0000000..50792b1
--- /dev/null
@@ -0,0 +1,25 @@
+package Variable::Magic::TestDieRequired;
+
+use Test::More;
+
+use Variable::Magic qw/wizard cast/;
+
+my $wiz;
+
+BEGIN {
+ $wiz = wizard
+  data => sub { $_[1] },
+  free => sub { $_[1]->(); () };
+}
+
+sub hook (&) {
+ $^H |= 0x020000;
+ cast %^H, $wiz, shift;
+}
+
+BEGIN {
+ hook { pass 'in Variable::Magic::TestRequired hook' };
+ die 'turnip';
+}
+
+1;