File: 16-scan_line.t

package info (click to toggle)
libmodule-scandeps-perl 1.23-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 576 kB
  • ctags: 147
  • sloc: perl: 3,007; makefile: 8; ansic: 1
file content (34 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 3;
use Module::ScanDeps qw/scan_line/;

{
my $chunk=<<'EOT';
use strict;
EOT
my @array=scan_line($chunk);@array=sort @array;
is_deeply(\@array,[sort qw{strict.pm}]);
}

{
my $chunk=<<'EOT';
require 5.10;
EOT
my @array=scan_line($chunk);@array=sort @array;
is_deeply(\@array,[sort qw{feature.pm}]);
}

{# RT#48151
my $chunk=<<'EOT';
require __PACKAGE__ . "SomeExt.pm";
EOT
eval {
  scan_line($chunk);
};
is($@,'');
}