File: pkgjs-depends

package info (click to toggle)
pkg-js-tools 0.17.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,036 kB
  • sloc: perl: 5,006; sh: 840; makefile: 36; javascript: 22
file content (66 lines) | stat: -rwxr-xr-x 1,581 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
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
65
66
#!/usr/bin/perl

use strict;
use Test::More;
use Dpkg::IPC;

my $out;
$ENV{HOME} = $ENV{AUTOPKGTEST_TMP} if $ENV{AUTOPKGTEST_TMP};

my $noCache;
spawn(
    exec            => [qw(apt-file update)],
    no_check        => 1,
    # XXX: Backwards compatibility, remove after dpkg 1.24.0.
    nocheck         => 1,
    wait_child      => 1,
    error_to_string => \$out,
);
if ($?) {
    $noCache = 1;
    diag "apt-file update failed";
}
spawn(
    exec       => [qw(pkgjs-depends glob@7.2.0)],
    no_check   => 1,
    # XXX: Backwards compatibility, remove after dpkg 1.24.0.
    nocheck    => 1,
    wait_child => 1,
    to_string  => \$out,
);

if ($?) {
    fail "pkgjs-depends failed";
}
else {
    diag "RESULT:\n$out";
    if ($noCache) {
        ok( $out =~ /# glob\@7.2.0/s, 'It displays title' );
    }
    else {
        ok( $out =~ /# glob\@7.2.0\s+\(node-glob\)/s,
            'It detects Debian package' );
    }
    ok( $out =~ /DEPENDENCIES:\s+node-\S+\s+\(\S+\)/s,
        "It detects packaged dependencies" );
    ok( $out !~ /MISSING/s, "It doesn't detect any missing dependency" );
}
spawn(
    exec       => [qw(pkgjs-depends cross-spawn)],
    no_check   => 1,
    # XXX: Backwards compatibility, remove after dpkg 1.24.0.
    nocheck    => 1,
    wait_child => 1,
    to_string  => \$out,
);

if ($?) {
    fail "pkgjs-depends failed";
}
else {
    diag "RESULT:\n$out";
    ok( $out =~ /# cross-spawn\@([\d\.\-\w]+)/s, "It displays version ($1)" );
    ok( $out =~ /cross-spawn.*BANNED/m,
        'It detects that cross-spawn is banned' );
}
done_testing();