Kaynağa Gözat

test: Correctly iterate over all default and passed .dsc template substvars

The code was returning all keys and values for %default_substvars,
when instead we should have been requesting all %default_substvars
and %options keys.
Guillem Jover 9 yıl önce
ebeveyn
işleme
028bfa99a0
2 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 1 0
      debian/changelog
  2. 1 1
      scripts/t/dpkg_source.t

+ 1 - 0
debian/changelog

@@ -35,6 +35,7 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
       Prompted by Stuart Prescott <stuart@debian.org>.
       Prompted by Stuart Prescott <stuart@debian.org>.
   * Test suite:
   * Test suite:
     - Generate and check all currently possible architecture wildcards.
     - Generate and check all currently possible architecture wildcards.
+    - Correctly iterate over all default and passed .dsc template substvars.
 
 
   [ Updated programs translations ]
   [ Updated programs translations ]
   * German (Sven Joachim).
   * German (Sven Joachim).

+ 1 - 1
scripts/t/dpkg_source.t

@@ -89,7 +89,7 @@ sub gen_source
     my (%options) = @_;
     my (%options) = @_;
 
 
     my $substvars = Dpkg::Substvars->new();
     my $substvars = Dpkg::Substvars->new();
-    foreach my $var (%default_substvars) {
+    foreach my $var ((keys %default_substvars, keys %options)) {
         my $value = $options{$var} // $default_substvars{$var};
         my $value = $options{$var} // $default_substvars{$var};
 
 
         $substvars->set_as_auto($var, $value);
         $substvars->set_as_auto($var, $value);