summaryrefslogtreecommitdiff
path: root/t/import_error.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2014-02-06 22:09:40 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2014-02-06 22:09:40 +0000
commit3621e4956cb037811317b0195d3248108c6658c3 (patch)
tree3b72d0c777a6299cb8e96bfdc856487b7358f605 /t/import_error.t
downloadModule-Runtime-tarball-master.tar.gz
Module-Runtime-0.014HEADModule-Runtime-0.014master
Diffstat (limited to 't/import_error.t')
-rw-r--r--t/import_error.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/import_error.t b/t/import_error.t
new file mode 100644
index 0000000..b9b8de3
--- /dev/null
+++ b/t/import_error.t
@@ -0,0 +1,35 @@
+use warnings;
+use strict;
+
+use Test::More tests => 3;
+
+eval q{#line 11 "test_eval"
+ use Module::Runtime qw(foo);
+};
+$@ =~ s/\(eval [0-9]+\) line 2/test_eval line 11/ if "$]" < 5.006001;
+like $@, qr/\A
+ \"foo\"\ is\ not\ exported\ by\ the\ Module::Runtime\ module\n
+ Can't\ continue\ after\ import\ errors\ at\ test_eval\ line\ 11.\n
+/x;
+
+eval q{#line 22 "test_eval"
+ use Module::Runtime qw(require_module.1);
+};
+$@ =~ s/\(eval [0-9]+\) line 2/test_eval line 22/ if "$]" < 5.006001;
+like $@, qr/\A
+ \"require_module.1\"\ is\ not\ exported
+ \ by\ the\ Module::Runtime\ module\n
+ Can't\ continue\ after\ import\ errors\ at\ test_eval\ line\ 22.\n
+/x;
+
+eval q{#line 33 "test_eval"
+ use Module::Runtime qw(foo require_module bar);
+};
+$@ =~ s/\(eval [0-9]+\) line 2/test_eval line 33/ if "$]" < 5.006001;
+like $@, qr/\A
+ \"foo\"\ is\ not\ exported\ by\ the\ Module::Runtime\ module\n
+ \"bar\"\ is\ not\ exported\ by\ the\ Module::Runtime\ module\n
+ Can't\ continue\ after\ import\ errors\ at\ test_eval\ line\ 33.\n
+/x;
+
+1;