chiark / gitweb /
test suite: gdr-unprocessable-hints: New test
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 23:25:36 +0000 (00:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 23:25:54 +0000 (00:25 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control
tests/tests/gdr-unprocessable-hints [new file with mode: 0755]

index aa785b2..a909f10 100644 (file)
@@ -16,7 +16,7 @@ Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc
 Restrictions: x-dgit-intree-only x-dgit-git-only
 
-Tests: gdr-diverge-nmu gdr-diverge-nmu-dgit gdr-edits gdr-import-dgit gdr-import-dgitview gdr-import-nostitch gdr-makepatches7 gdr-subcommands gdr-unprocessable
+Tests: gdr-diverge-nmu gdr-diverge-nmu-dgit gdr-edits gdr-import-dgit gdr-import-dgitview gdr-import-nostitch gdr-makepatches7 gdr-subcommands gdr-unprocessable gdr-unprocessable-hints
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, git-debrebase, git-buildpackage, faketime
 
diff --git a/tests/tests/gdr-unprocessable-hints b/tests/tests/gdr-unprocessable-hints
new file mode 100755 (executable)
index 0000000..710d7c9
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-dependencies GDR
+
+t-tstunt-parsechangelog
+t-setup-import gdr-convert-gbp
+
+cd $p
+
+b=gdr-unprocessable/origin
+
+git checkout $b
+t-expect-fail E:'maybe you needed git-debrebase convert-from' \
+t-git-debrebase quick
+
+git update-ref refs/ffq-prev/heads/$b master
+t-expect-fail E:'Consider git-debrebase scrap' \
+t-git-debrebase quick
+
+git update-ref -d refs/ffq-prev/heads/$b master
+git update-ref refs/debrebase-last/heads/$b HEAD
+t-expect-fail E:'Branch/history seems mangled' \
+t-git-debrebase quick
+test "$(grep 'git-debrebase scrap' ../t.output)" = ""
+
+git update-ref refs/debrebase-last/heads/$b master
+t-expect-fail E:'Branch/history mangled, and diverged' \
+t-git-debrebase quick
+test "$(grep 'git-debrebase scrap' ../t.output)" = ""
+
+t-ok