t7800: don't hide grep output
Remove the stdin_contains and stdin_doesnt_contain helper functions which add nothing but hide the output of grep, hurting debugging. Suggested-by: Johannes Sixt <j.sixt@viscovery.net> Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
67aa147af7
commit
472353a579
@ -23,16 +23,6 @@ prompt_given ()
|
|||||||
test "$prompt" = "Launch 'test-tool' [Y/n]: branch"
|
test "$prompt" = "Launch 'test-tool' [Y/n]: branch"
|
||||||
}
|
}
|
||||||
|
|
||||||
stdin_contains ()
|
|
||||||
{
|
|
||||||
grep >/dev/null "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
stdin_doesnot_contain ()
|
|
||||||
{
|
|
||||||
! stdin_contains "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create a file on master and change it on branch
|
# Create a file on master and change it on branch
|
||||||
test_expect_success PERL 'setup' '
|
test_expect_success PERL 'setup' '
|
||||||
echo master >file &&
|
echo master >file &&
|
||||||
@ -296,24 +286,24 @@ test_expect_success PERL 'setup with 2 files different' '
|
|||||||
test_expect_success PERL 'say no to the first file' '
|
test_expect_success PERL 'say no to the first file' '
|
||||||
(echo n && echo) >input &&
|
(echo n && echo) >input &&
|
||||||
git difftool -x cat branch <input >output &&
|
git difftool -x cat branch <input >output &&
|
||||||
stdin_contains m2 <output &&
|
grep m2 output &&
|
||||||
stdin_contains br2 <output &&
|
grep br2 output &&
|
||||||
stdin_doesnot_contain master <output &&
|
! grep master output &&
|
||||||
stdin_doesnot_contain branch <output
|
! grep branch output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'say no to the second file' '
|
test_expect_success PERL 'say no to the second file' '
|
||||||
(echo && echo n) >input &&
|
(echo && echo n) >input &&
|
||||||
git difftool -x cat branch <input >output &&
|
git difftool -x cat branch <input >output &&
|
||||||
stdin_contains master <output &&
|
grep master output &&
|
||||||
stdin_contains branch <output &&
|
grep branch output &&
|
||||||
stdin_doesnot_contain m2 <output &&
|
! grep m2 output &&
|
||||||
stdin_doesnot_contain br2 <output
|
! grep br2 output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'difftool --tool-help' '
|
test_expect_success PERL 'difftool --tool-help' '
|
||||||
git difftool --tool-help >output &&
|
git difftool --tool-help >output &&
|
||||||
stdin_contains tool <output
|
grep tool output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'setup change in subdirectory' '
|
test_expect_success PERL 'setup change in subdirectory' '
|
||||||
@ -330,28 +320,28 @@ test_expect_success PERL 'setup change in subdirectory' '
|
|||||||
|
|
||||||
test_expect_success PERL 'difftool -d' '
|
test_expect_success PERL 'difftool -d' '
|
||||||
git difftool -d --extcmd ls branch >output &&
|
git difftool -d --extcmd ls branch >output &&
|
||||||
stdin_contains sub <output &&
|
grep sub output &&
|
||||||
stdin_contains file <output
|
grep file output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'difftool --dir-diff' '
|
test_expect_success PERL 'difftool --dir-diff' '
|
||||||
git difftool --dir-diff --extcmd ls branch >output &&
|
git difftool --dir-diff --extcmd ls branch >output &&
|
||||||
stdin_contains sub <output &&
|
grep sub output &&
|
||||||
stdin_contains file <output
|
grep file output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'difftool --dir-diff ignores --prompt' '
|
test_expect_success PERL 'difftool --dir-diff ignores --prompt' '
|
||||||
git difftool --dir-diff --prompt --extcmd ls branch >output &&
|
git difftool --dir-diff --prompt --extcmd ls branch >output &&
|
||||||
stdin_contains sub <output &&
|
grep sub output &&
|
||||||
stdin_contains file <output
|
grep file output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'difftool --dir-diff from subdirectory' '
|
test_expect_success PERL 'difftool --dir-diff from subdirectory' '
|
||||||
(
|
(
|
||||||
cd sub &&
|
cd sub &&
|
||||||
git difftool --dir-diff --extcmd ls branch >output &&
|
git difftool --dir-diff --extcmd ls branch >output &&
|
||||||
stdin_contains sub <output &&
|
grep sub output &&
|
||||||
stdin_contains file <output
|
grep file output
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user