Просмотр исходного кода

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.
Raphaël Hertzog лет назад: 17
Родитель
Сommit
5e435949d6
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      scripts/t/100_Dpkg_Version.t

+ 4 - 1
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) {