X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vcs%2Ft%2Ftest.sh;fp=vcs%2Ft%2Ftest.sh;h=6f1084b263486c2e1082e10e10bab56e97764ed5;hb=40b6f5b91142a2893422479122704dd7ba91fe99;hp=0000000000000000000000000000000000000000;hpb=e64f5aca9dff4e4a0cd8ced5d8131a06addb85ab;p=config%2Fdotfiles.git
diff --git a/vcs/t/test.sh b/vcs/t/test.sh
new file mode 100755
index 0000000..6f1084b
--- /dev/null
+++ b/vcs/t/test.sh
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+# Small test file to check different --word-diff-regex settings in Git.
+
+# Copyright (C) 2012-2014 Simon Ruderich
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+set -eu
+
+git_diff() {
+ git diff --color=never --word-diff=plain --word-diff-regex="$1" \
+ | grep -v '^index ' >"result-$2.txt"
+ diff -u "../expected-$2.txt" "result-$2.txt"
+}
+
+
+# Setup test directory/files.
+mkdir test
+cd test
+
+git init >/dev/null
+cat >test.txt </dev/null
+
+cat >test.txt <