summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2013-11-25 00:53:51 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2013-11-25 00:53:51 +0000
commite29e052f34677e876f86e317f20d784c765f5c5a (patch)
tree875abca280b8d501702784ce4885bff900a9e2e9 /tests
parentb11d254ac6498816597677aa69ca5d53f5b60720 (diff)
autopkgtests: break out t-822-field
Diffstat (limited to 'tests')
-rw-r--r--tests/lib23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/lib b/tests/lib
index 2842b92..b80989d 100644
--- a/tests/lib
+++ b/tests/lib
@@ -188,16 +188,23 @@ t-pushed-good () {
git verify-tag `t-v-tag`
}
-t-ref-dsc-dgit () {
- local dsc=${p}_${v}.dsc
- local val=`perl -e '
+t-822-field () {
+ local file=$1
+ local field=$2
+ perl -e '
use Dpkg::Control::Hash;
my $h = new Dpkg::Control::Hash allow_pgp=>1;
- $h->parse(\*STDIN,"dsc");
- my $ref = $h->{"Dgit"},"\n";
- die unless $ref =~ m/^\w+\b/;
- print $ref,"\n";
- ' <$tmp/incoming/$dsc`
+ $h->parse(\*STDIN,"'"$file"'");
+ my $val = $h->{"'$field'"},"\n";
+ die "'"$file $field"'" unless defined $val;
+ print $val,"\n";
+ ' <$file
+}
+
+t-ref-dsc-dgit () {
+ local dsc=${p}_${v}.dsc
+ local val=`t-822-field $tmp/incoming/$dsc Dgit`
+ perl -e '$_=shift @ARGV; die "$dsc Dgit $_ ?" unless m/^\w+\b/;' "$val"
t-ref-same-val $dsc "$val"
}