summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2010-01-15 14:03:42 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-15 15:04:20 -0800
commita9e11220c2656cc5d7baac4d0735c04f9be46438 (patch)
treeebe45edf125ff699ce725d3b172f405959ed02d0
parent3bdfd44309822d4a2c49d381999ad5cc7e61ed5f (diff)
downloadgit-a9e11220c2656cc5d7baac4d0735c04f9be46438.tar.gz
t7800-difftool.sh: Simplify the --extcmd test
Instead of running 'grep', 'echo', and 'wc' we simply compare git-difftool's output against a known good value. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7800-difftool.sh13
1 files changed, 5 insertions, 8 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 8ee186a5fb..1d9e07b0d8 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -15,6 +15,9 @@ if ! test_have_prereq PERL; then
test_done
fi
+LF='
+'
+
remove_config_vars()
{
# Unset all config variables used by git-difftool
@@ -219,19 +222,13 @@ test_expect_success 'difftool.<tool>.path' '
restore_test_defaults
'
-test_expect_success 'difftool --extcmd=...' '
+test_expect_success 'difftool --extcmd=cat' '
diff=$(git difftool --no-prompt --extcmd=cat branch) &&
+ test "$diff" = branch"$LF"master
- lines=$(echo "$diff" | wc -l) &&
- test "$lines" -eq 2 &&
- lines=$(echo "$diff" | grep master | wc -l) &&
- test "$lines" -eq 1 &&
- lines=$(echo "$diff" | grep branch | wc -l) &&
- test "$lines" -eq 1 &&
- restore_test_defaults
'
test_done