File: parent.t

package info (click to toggle)
libperl-prereqscanner-notquitelite-perl 0.9917-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 944 kB
  • sloc: perl: 5,239; makefile: 2
file content (50 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../";
use Test::More;
use t::Util;

local $t::Util::EVAL = 1;

test('parent singlequotes', <<'END', {parent => 0, Exporter => 0});
use parent 'Exporter';
END

test('parent doublequotes', <<'END', {parent => 0, Exporter => 0});
use parent "Exporter";
END

test('parent qw()', <<'END', {parent => 0, Exporter => 0});
use parent qw(Exporter);
END

test('parent multilined qw()', <<'END', {parent => 0, Exporter => 0});
use parent qw(
  Exporter
);
END

test('parent bareword (only works without strict)', <<'END', {parent => 0, Exporter => 0});
use parent Exporter;
END

test('parent + function', <<'END', {parent => 0});
sub function {}
use parent function();
END

test('parent + ()', <<'END', {parent => 0});
use parent ();
END

test('parent + (bareword)', <<'END', {parent => 0, Carp => 0});
use parent (Carp);
END

# incompatible with Perl::PrereqScanner, which counts Test::More as well
test('-norequire', <<'END', {parent => 0});
use parent -norequire, 'Test::More';
END

done_testing;