]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - t/test.sh
t/test.sh: minor cleanup
[config/dotfiles.git] / t / test.sh
index 81e3b12aaf36c0240186ca04f6c8665dce54b8f1..6f1084b263486c2e1082e10e10bab56e97764ed5 100755 (executable)
--- a/t/test.sh
+++ b/t/test.sh
@@ -2,7 +2,7 @@
 
 # Small test file to check different --word-diff-regex settings in Git.
 
-# Copyright (C) 2012  Simon Ruderich
+# 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set -e
+set -eu
 
 git_diff() {
     git diff --color=never --word-diff=plain --word-diff-regex="$1" \
-        | grep -v '^index ' > "result-$2.txt"
+        | grep -v '^index ' >"result-$2.txt"
     diff -u "../expected-$2.txt" "result-$2.txt"
 }
 
@@ -31,8 +31,8 @@ git_diff() {
 mkdir test
 cd test
 
-git init > /dev/null
-cat > test.txt <<EOF
+git init >/dev/null
+cat >test.txt <<EOF
 Tests
 =====
 
@@ -61,9 +61,9 @@ allow = \$! \$? \$.
 allow = \$! \$? \$.
 EOF
 git add test.txt
-git commit -m 'Initial commit.' > /dev/null
+git commit -m 'Initial commit.' >/dev/null
 
-cat > test.txt <<EOF
+cat >test.txt <<EOF
 Tests
 ====