summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-17 12:53:47 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-17 12:53:47 +0000
commit005625309ea693fcb6e95b595c2395a9c533dd3d (patch)
treebba0ea676f07a172c651b2487b7ffd88faf4d3f8 /tests
parente7a1580f7fb3ee23bf36de01a055a4b48a817d0c (diff)
test suite: gitattributes: Break out sums_check_broken
No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests/gitattributes29
1 files changed, 19 insertions, 10 deletions
diff --git a/tests/tests/gitattributes b/tests/tests/gitattributes
index dec85b5..83fa610 100755
--- a/tests/tests/gitattributes
+++ b/tests/tests/gitattributes
@@ -121,6 +121,24 @@ sums_check () {
diff -U0 ../sums ../$sums
}
+sums_check_broken () {
+ # caller should cd into working directory, set
+ # $sums
+ # and check out the broken branch
+
+ sha256sum af/* >../$sums.broken
+
+ for s in ../sums ../$sums.broken; do
+ sed 's/[0-9a-f]* //' $s >$s.nosums
+ done
+ diff -U0 ../sums.nosums ../$sums.broken.nosums
+ set +e
+ diff -U0 ../sums ../$sums.broken
+ rc=$?
+ set -e
+ test $rc = 1
+}
+
t-dgit-warn-check () {
local warnok=$1; shift
# warnok should be 0 if the warning is expected
@@ -153,17 +171,8 @@ sfmt_import () {
t-dgit-warn-check 0 $dgitargs import-dsc ../$dscf +$branch.broken
git checkout $branch.broken
- sha256sum af/* >../$sums.broken
- for s in ../sums ../$sums.broken; do
- sed 's/[0-9a-f]* //' $s >$s.nosums
- done
- diff -U0 ../sums.nosums ../$sums.broken.nosums
- set +e
- diff -U0 ../sums ../$sums.broken
- rc=$?
- set -e
- test $rc = 1
+ sums_check_broken
t-dgit setup-new-tree