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>
David Aguilar committed
Jan 15, 2010 at 14:03 UTC
a9e11220c2656cc5d7baac4d0735c04f9be46438
1 file changed
+5
-8
t/t7800-difftool.sh
+5
-8
@@ -15,6 +15,9 @@ if ! test_have_prereq PERL; then
15
test_done
16
fi
17
18
+LF='
19
+'
20
+
21
remove_config_vars()
22
{
23
# Unset all config variables used by git-difftool
@@ -219,19 +222,13 @@ test_expect_success 'difftool.<tool>.path' '
222
restore_test_defaults
223
'
224
222
-test_expect_success 'difftool --extcmd=...' '
225
+test_expect_success 'difftool --extcmd=cat' '
226
diff=$(git difftool --no-prompt --extcmd=cat branch) &&
227
+ test "$diff" = branch"$LF"master
228
225
- lines=$(echo "$diff" | wc -l) &&
226
- test "$lines" -eq 2 &&
229
228
- lines=$(echo "$diff" | grep master | wc -l) &&
229
- test "$lines" -eq 1 &&
230
231
- lines=$(echo "$diff" | grep branch | wc -l) &&
232
- test "$lines" -eq 1 &&
231
234
- restore_test_defaults
232
'
233
234
test_done