summaryrefslogtreecommitdiff
path: root/t/13except-arg0.t
diff options
context:
space:
mode:
Diffstat (limited to 't/13except-arg0.t')
-rw-r--r--t/13except-arg0.t22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/13except-arg0.t b/t/13except-arg0.t
new file mode 100644
index 0000000..5bc9497
--- /dev/null
+++ b/t/13except-arg0.t
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Error qw(:try);
+use Test::More tests => 2;
+
+my $arg_0;
+
+try {
+ throw Error::Simple( "message" );
+}
+except {
+ $arg_0 = shift;
+ return {
+ 'Error::Simple' => sub {},
+ };
+};
+
+ok( defined $arg_0, 'defined( $_[0] ) after throw/except' );
+ok( ref $arg_0 && $arg_0->isa( "Error::Simple" ), '$_[0]->isa( "Error::Simple" ) after throw/except' );