diff options
author | Guillem Jover <guillem@debian.org> | 2014-04-24 03:22:57 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-04-26 18:24:45 +0200 |
commit | 757999904994ce29b4e13615d3c6b1502e85d84a (patch) | |
tree | 38cf755b1cc05b03d9e31bcb79d3ba8c44e892e1 /scripts/t/Dpkg_Dist_Files.t | |
parent | f87633813519bcce2f7ef0f573a55d436382a6e8 (diff) | |
download | dpkg-757999904994ce29b4e13615d3c6b1502e85d84a.tar.gz |
Dpkg::Dist:Files: Add test cases for get_file()
Diffstat (limited to 'scripts/t/Dpkg_Dist_Files.t')
-rw-r--r-- | scripts/t/Dpkg_Dist_Files.t | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/t/Dpkg_Dist_Files.t b/scripts/t/Dpkg_Dist_Files.t index 6ec05f9ce..d01ad6812 100644 --- a/scripts/t/Dpkg_Dist_Files.t +++ b/scripts/t/Dpkg_Dist_Files.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 15; use_ok('Dpkg::Dist::Files'); @@ -76,8 +76,14 @@ BY-HAND-file webdocs optional is($dist->output(), $expected, 'Parsed dist file'); foreach my $f ($dist->get_files()) { - is_deeply($f, $expected{$f->{filename}}, - "Detail for individual dist file $f->{filename}"); + my $filename = $f->{filename}; + + is_deeply($f, $expected{$filename}, + "Detail for individual dist file $filename, via get_files()"); + + my $fs = $dist->get_file($filename); + is_deeply($fs, $expected{$filename}, + "Detail for individual dist file $filename, via get_file()"); } $expected = 'pkg-templ_1.2.3_arch.type section priority @@ -90,6 +96,8 @@ added-on-the-fly void wish $dist->add_file('added-on-the-fly', 'void', 'wish'); $dist->add_file('pkg-arch_2.0.0_amd64.deb', 'void', 'imperative'); $dist->del_file('pkg-indep_0.0.1-2_all.deb'); +is($dist->get_file('unknown'), undef, 'Get unknown file'); +is($dist->get_file('pkg-indep_0.0.1-2_all.deb'), undef, 'Get deleted file'); is($dist->output(), $expected, 'Modified dist object'); 1; |