summaryrefslogtreecommitdiff
path: root/scripts/t/Dpkg_Changelog.t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-05-15 16:18:39 +0200
committerGuillem Jover <guillem@debian.org>2016-07-03 18:44:21 +0200
commit852242677f4bc308f17564660927dbd8569c3d2e (patch)
tree320de8400e6647cd33947e41ee8b49b899051f5b /scripts/t/Dpkg_Changelog.t
parentc7fc55a0b1d82dd2056d8f0a35d016f976ba6fab (diff)
downloaddpkg-852242677f4bc308f17564660927dbd8569c3d2e.tar.gz
Dpkg::Changelog: Add new format_range() method
Deprecate dpkg() and rfc822() methods by this new method, which has a more clear name and generic interface.
Diffstat (limited to 'scripts/t/Dpkg_Changelog.t')
-rw-r--r--scripts/t/Dpkg_Changelog.t16
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/t/Dpkg_Changelog.t b/scripts/t/Dpkg_Changelog.t
index c66f40af8..c095692d0 100644
--- a/scripts/t/Dpkg_Changelog.t
+++ b/scripts/t/Dpkg_Changelog.t
@@ -166,7 +166,7 @@ foreach my $file ("$datadir/countme", "$datadir/shadow", "$datadir/fields",
#TODO: test combinations
}
if ($file eq "$datadir/fields") {
- my $str = $changes->dpkg({ all => 1 });
+ my $str = $changes->format_range('dpkg', { all => 1 });
my $expected = 'Source: fields
Version: 2.0-0etch1
Distribution: stable
@@ -201,13 +201,14 @@ Changes:
* First upload (Closes: #1000000)
Xb-Userfield2: foobar
Xc-Userfield: foobar
+
';
if ($vendor eq 'Ubuntu') {
$expected =~ s/^(Closes:.*)/$1\nLaunchpad-Bugs-Fixed: 12345 54321 424242 2424242/m;
}
cmp_ok($str, 'eq', $expected, 'fields handling');
- $str = $changes->dpkg({ offset => 1, count => 2 });
+ $str = $changes->format_range('dpkg', { offset => 1, count => 2 });
$expected = 'Source: fields
Version: 2.0-1
Distribution: unstable frozen
@@ -232,13 +233,14 @@ Changes:
.
* Beta
Xc-Userfield: foobar
+
';
if ($vendor eq 'Ubuntu') {
$expected =~ s/^(Closes:.*)/$1\nLaunchpad-Bugs-Fixed: 12345 424242/m;
}
cmp_ok($str, 'eq', $expected, 'fields handling 2');
- $str = $changes->rfc822({ offset => 2, count => 2 });
+ $str = $changes->format_range('rfc822', { offset => 2, count => 2 });
$expected = 'Source: fields
Version: 2.0~b1-1
Distribution: unstable
@@ -297,7 +299,7 @@ Xb-Userfield2: foobar
'get date w/ DoW, and zero timezone offset');
}
if ($file eq "$datadir/regressions") {
- my $f = $changes->dpkg();
+ my $f = ($changes->format_range('dpkg'))[0];
is("$f->{Version}", '0', 'version 0 correctly parsed');
}
@@ -306,13 +308,13 @@ Xb-Userfield2: foobar
if @data == 1;
my $oldest_version = $data[-1]->{Version};
- $str = $changes->dpkg({ since => $oldest_version });
+ $str = $changes->format_range('dpkg', { since => $oldest_version });
- $str = $changes->rfc822();
+ $str = $changes->format_range('rfc822');
ok(1, 'TODO check rfc822 output');
- $str = $changes->rfc822({ since => $oldest_version });
+ $str = $changes->format_range('rfc822', { since => $oldest_version });
ok(1, 'TODO check rfc822 output with ranges');
}