summaryrefslogtreecommitdiff
path: root/t/03throw-non-Error.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2012-05-08 18:20:12 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-10-03 12:23:37 +0000
commit661707e7bd4282aeab5a2f6a8f02ca5731fd813f (patch)
tree9b32ff910278233ad929888499ca8380f2696582 /t/03throw-non-Error.t
downloaderror-perl-tarball-661707e7bd4282aeab5a2f6a8f02ca5731fd813f.tar.gz
Imported from /srv/lorry/lorry-area/error-perl-tarball/Error-0.17018.tar.gz.baserock/morph
Diffstat (limited to 't/03throw-non-Error.t')
-rw-r--r--t/03throw-non-Error.t32
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.");