chiark / gitweb /
test suite: tagupl: test one bad tag
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 6 Jul 2019 16:33:29 +0000 (17:33 +0100)
committerSean Whitton <spwhitton@spwhitton.name>
Sun, 7 Jul 2019 08:54:19 +0000 (09:54 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/tagupl

index 7859400712926c015d5c24423819e27249806a17..c45f5e927d81086e87d79f9f6fdfab36796840e8 100755 (executable)
@@ -30,6 +30,39 @@ tagname=test-dummy/$v
 t-tagupl-test --no-push --quilt=gbp
 
 # xxx test pushing
+
 # todo: test each miss/rejection
 
+ident=ok
+
+git cat-file tag $tagname >../basetag
+v=1.0-2
+tagname=test-dummy/$v
+
+perl -i -ne '
+       next if $.==1../^$/;
+       next if m/^----/..0;
+       s/\b1\.0-1\b/1.0-2/g;
+       print or die $!;
+' ../basetag
+
+with-mangled () {
+       local perl=$1
+       perl <../basetag >../badtag-$ident -pe "$perl"
+       git tag -u Senatus -f -s -m "$(cat ../badtag-$ident)" "$tagname"
+
+       t-tagupl-run-drs
+}
+
+expect-quit () {
+       mv ../tagupl/overall.log ../tagupl/overall.log-$ident
+       ident=$1
+       local perl=$2
+       local mstring=$3
+       with-mangled "$perl"
+       grep ": $mstring" ../tagupl/overall.log
+}
+
+expect-quit noplease s/please-upload/plunk/ 'tag missing please-upload'
+
 t-ok