summaryrefslogtreecommitdiff
path: root/tests/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/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