chiark / gitweb /
Test suite: unrepresentable: New test
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Oct 2016 19:49:24 +0000 (20:49 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Oct 2016 00:01:11 +0000 (01:01 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/tests/control
tests/tests/unrepresentable [new file with mode: 0755]

index 8ff52ae..608cb69 100644 (file)
@@ -21,7 +21,7 @@ Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts
 Restrictions: x-dgit-git-only
 
-Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast import-native import-nonnative inarchivecopy mismatches newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay version-opt
+Tests: build-modes build-modes-asplit build-modes-gbp-asplit clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast import-native import-nonnative inarchivecopy mismatches newtag-clone-nogit oldnewtagalt oldtag-clone-nogit overwrite-chkclog overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts
 
diff --git a/tests/tests/unrepresentable b/tests/tests/unrepresentable
new file mode 100755 (executable)
index 0000000..88a6972
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-tstunt-parsechangelog
+
+t-prep-newpackage example 1.0
+
+ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .
+
+cd $p
+
+start () { git checkout quilt-tip~0; }
+attempt () { t-dgit -wgf --quilt=smash quilt-fixup; }
+
+badly-1 () {
+       wrongfn=$1
+       wrongmsg=$2
+       start
+}
+
+badly-2 () {
+       git commit -m "Commit wrongness $wrongfn ($wrongmsg)"
+       t-expect-fail "cannot represent change: $wrongmsg: $wrongfn" \
+       attempt
+}
+
+badly-1 symlink 'not a plain file'
+       ln -s TARGET symlink
+       git add symlink
+badly-2
+
+badly-1 src.c deleted
+       git rm src.c
+badly-2
+
+badly-1 src.c 'mode changed'
+       chmod +x src.c
+       git add src.c
+badly-2
+
+badly-1 new 'non-default mode'
+       echo hi >new
+       chmod 755 new
+       git add new
+badly-2
+
+start
+attempt
+
+echo ok.