File: import_error.t

package info (click to toggle)
libmodule-runtime-perl 0.018-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292 kB
  • sloc: perl: 264; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;