summaryrefslogtreecommitdiffstats
path: root/t/try/syntax.t
diff options
context:
space:
mode:
Diffstat (limited to 't/try/syntax.t')
-rw-r--r--t/try/syntax.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/try/syntax.t b/t/try/syntax.t
new file mode 100644
index 0000000..8e8a6e0
--- /dev/null
+++ b/t/try/syntax.t
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use lib 't/try/lib';
+
+use Try;
+
+my $err;
+
+try {
+ require Error1;
+}
+catch {
+ $err = $_;
+}
+like(
+ $err,
+ qr/Can't call method "finallyy" without a package or object reference at |Can't locate object method "finallyy" via package "1" \(perhaps you forgot to load "1"\?\) at /,
+);
+
+try {
+ require Error2;
+}
+catch {
+ $err = $_;
+}
+like(
+ $err,
+ qr/Can't call method "catch" without a package or object reference at |Can't locate object method "catch" via package "1" \(perhaps you forgot to load "1"\?\) at /,
+);
+
+done_testing;