File: basic.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 (64 lines) | stat: -rw-r--r-- 1,229 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../";
use Test::More;
use t::Util;

test_app('.pm file in the root', sub {
  my $tmpdir = shift;

  test_file("$tmpdir/MyTest.pm", <<'END');
use strict;
use warnings;
END
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}});

test_app('.pm file under lib', sub {
  my $tmpdir = shift;

  test_file("$tmpdir/lib/MyTest.pm", <<'END');
use strict;
use warnings;
END
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}});

test_app('inc', sub {
  my $tmpdir = shift;

  test_file("$tmpdir/MyTest.pm", <<'END');
use strict;
use warnings;
use Foo::Bar;
END

  test_file("$tmpdir/inc/Foo/Bar.pm", <<'END');
package Foo::Bar;
1;
END
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}});

test_app('ignore local file', sub {
  my $tmpdir = shift;

  test_file("$tmpdir/MyTest.pm", <<'END');
use strict;
use warnings;
END

  test_file("$tmpdir/MyTest2.pm", <<'END');
use MyTest;
END
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}});

test_app('ignore Makefile.PL under t', sub {
  my $tmpdir = shift;

  test_file("$tmpdir/t/Makefile.PL", <<'END');
use strict;
use warnings;
use Foo;
END
}, {});

done_testing;