diff options
Diffstat (limited to 't/03throw-non-Error.t')
-rw-r--r-- | t/03throw-non-Error.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/03throw-non-Error.t b/t/03throw-non-Error.t new file mode 100644 index 0000000..03ef624 --- /dev/null +++ b/t/03throw-non-Error.t @@ -0,0 +1,32 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Error (qw(:try)); +use Test::More tests => 2; + +my $count_of_Error = 0; +eval +{ +try +{ + die +{ 'private' => "Shlomi", 'family' => "Fish" }; +} +catch Error with +{ + my $err = shift; + $count_of_Error++; +} +}; +my $exception = $@; + +# TEST +is_deeply ( + $exception, + +{'private' => "Shlomi", 'family' => "Fish"}, + "Testing for thrown exception", +); + +# TEST +is ($count_of_Error, 0, "No Errors caught."); |