aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-12 12:28:34 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-12 12:57:25 -0800
commite726715a52e25d8035c89d4ea09398599610737e (patch)
tree7951b21bec4120db31c693f8491e62e3908e690c /t
parentd28c8af623b0d15740c2af0106d8e2bf54a3ac52 (diff)
downloadgit-e726715a52e25d8035c89d4ea09398599610737e.tar.gz
git-e726715a52e25d8035c89d4ea09398599610737e.tar.xz
Add deltifier test.
This test kicks in only if you built test-delta executable, and makes sure that the basic delta routine is working properly even on empty files. This commit is to make sure we have a test to catch the breakage. The delitifier code is still broken, which will be fixed with the next commit. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rwxr-xr-xt/t0001-delta.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/t0001-delta.sh b/t/t0001-delta.sh
new file mode 100755
index 000000000..2dd88e503
--- /dev/null
+++ b/t/t0001-delta.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+test_description='Deltification regression test'
+
+../test-delta 2>/dev/null
+test $? == 127 && {
+ echo "* Skipping test-delta regression test."
+ exit 0
+}
+
+. ./test-lib.sh
+
+>empty
+echo small >small
+echo smallish >smallish
+cat ../../COPYING >large
+sed -e 's/GNU/G.N.U/g' large >largish
+
+test_expect_success 'No regression in deltify code' \
+'
+fail=0
+for src in empty small smallish large largish
+do
+ for dst in empty small smallish large largish
+ do
+ if test-delta -d $src $dst delta-$src-$dst &&
+ test-delta -p $src delta-$src-$dst out-$src-$dst &&
+ cmp $dst out-$src-$dst
+ then
+ echo "* OK ($src->$dst deitify and apply)"
+ else
+ echo "* FAIL ($src->$dst deitify and apply)"
+ fail=1
+ fi
+ done
+done
+case "$fail" in
+0) (exit 0) ;;
+*) (exit $fail) ;;
+esac
+'
+
+test_done