[go: up one dir, main page]

File: package.t

package info (click to toggle)
rex 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,800 kB
  • sloc: perl: 30,667; xml: 264; makefile: 8
file content (36 lines) | stat: -rw-r--r-- 926 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
use strict;
use warnings;

use Test::More tests => 4;

use Rex::Pkg::Base;

my $pkg = Rex::Pkg::Base->new;

my @plist1 = (
  { name => 'vim', version => '1.0' },
  { name => 'mc',  version => '2.0' },
  { name => 'rex', version => '0.51.0' },
);

my @plist2 = (
  { name => 'vim',       version => '1.0' },
  { name => 'rex',       version => '0.52.0' },
  { name => 'libssh2-1', version => '0.32.1' },
);

my @mods = $pkg->diff_package_list( \@plist1, \@plist2 );

my $found_vim = grep { $_->{name} eq "vim" } @mods;
is( $found_vim, 0, "vim was not modified" );

my ($found_rex) = grep { $_->{name} eq "rex" } @mods;
is( $found_rex->{action}, "updated", "rex was updated" );

my ($found_libssh2) = grep { $_->{name} eq "libssh2-1" } @mods;
is( $found_libssh2->{action}, "installed", "libssh2-1 was installed" );

my ($found_mc) = grep { $_->{name} eq "mc" } @mods;
is( $found_mc->{action}, "removed", "mc was removed" );

1;