зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
3bdfd44309
Коммит
a9e11220c2
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче