summaryrefslogtreecommitdiff
path: root/t/01throw.t
diff options
context:
space:
mode:
Diffstat (limited to 't/01throw.t')
-rw-r--r--t/01throw.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/01throw.t b/t/01throw.t
new file mode 100644
index 0000000..a1bdba2
--- /dev/null
+++ b/t/01throw.t
@@ -0,0 +1,25 @@
+
+use Error qw(:try);
+
+print "1..4\n";
+
+try {
+ print "ok 1\n";
+};
+
+
+try {
+ throw Error::Simple("ok 2\n",2);
+ print "not ok 2\n";
+}
+catch Error::Simple with {
+ my $err = shift;
+ print "$err";
+}
+finally {
+ print "ok 3\n";
+};
+
+$err = prior Error;
+
+print "ok ",2+$err,"\n";;