The following commit has been merged in the master branch:
commit 5e435949d6379f7dc930f042db5241af1e2ffb46
Author: Raphaël Hertzog <[email protected]>
Date: Thu Oct 1 19:28:40 2009 +0200
Ensure that the string representation of Dpkg::Version is unchanged
The version string used at creation time should be returned
when you stringify a Dpkg::Version object. Ensure this by adding a
non-regression test.
diff --git a/scripts/t/100_Dpkg_Version.t b/scripts/t/100_Dpkg_Version.t
index 2dc0957..1605fc4 100644
--- a/scripts/t/100_Dpkg_Version.t
+++ b/scripts/t/100_Dpkg_Version.t
@@ -15,7 +15,7 @@ my @ops = ("<", "<<", "lt",
">=", "ge",
">", ">>", "gt");
-plan tests => scalar(@tests) * (3 * scalar(@ops) + 2) + 1;
+plan tests => scalar(@tests) * (3 * scalar(@ops) + 4) + 1;
sub dpkg_vercmp {
my ($a, $cmp, $b) = @_;
@@ -67,6 +67,9 @@ foreach my $case (@tests) {
my $va = Dpkg::Version->new($a);
my $vb = Dpkg::Version->new($b);
+ is("$va", $a, "String representation of Dpkg::Version($a) is $a");
+ is("$vb", $b, "String representation of Dpkg::Version($b) is $b");
+
is(version_compare($a, $b), $res, "$a cmp $b => $res");
is($va <=> $vb, $res, "Dpkg::Version($a) <=> Dpkg::Version($b) => $res");
foreach my $op (@ops) {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]