All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] t7800-difftool.sh: Simplify the --extcmd test
@ 2010-01-15  7:16 David Aguilar
  2010-01-15  7:16 ` [PATCH 2/3] difftool: Add '-x' and as an alias for '--extcmd' David Aguilar
  2010-01-15  7:16 ` [PATCH 3/3] difftool: Use eval to expand '--extcmd' expressions David Aguilar
  0 siblings, 2 replies; 9+ messages in thread
From: David Aguilar @ 2010-01-15  7:16 UTC (permalink / raw)
  To: gitster; +Cc: git

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>
---
 t/t7800-difftool.sh |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 8ee186a..1d9e07b 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
-- 
1.6.6.6.g627fb.dirty

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-01-16 13:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-15  7:16 [PATCH 1/3] t7800-difftool.sh: Simplify the --extcmd test David Aguilar
2010-01-15  7:16 ` [PATCH 2/3] difftool: Add '-x' and as an alias for '--extcmd' David Aguilar
2010-01-15 19:46   ` Junio C Hamano
2010-01-15 19:54     ` Bill Lear
2010-01-16  1:05       ` Junio C Hamano
2010-01-16 13:44         ` Bill Lear
2010-01-15  7:16 ` [PATCH 3/3] difftool: Use eval to expand '--extcmd' expressions David Aguilar
2010-01-15  8:40   ` Johannes Sixt
2010-01-15 17:59     ` David Aguilar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.