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>

John Keeping committed Mar 29, 2013 at 11:28 UTC 472353a579b3c3fd645ea4f0aac582317e488775
1 file changed +17 -27
t/t7800-difftool.sh
+17 -27
@@ -23,16 +23,6 @@ prompt_given ()
23 test "$prompt" = "Launch 'test-tool' [Y/n]: branch"
24 }
25
26 -stdin_contains ()
27 -{
28 - grep >/dev/null "$1"
29 -}
30 -
31 -stdin_doesnot_contain ()
32 -{
33 - ! stdin_contains "$1"
34 -}
35 -
26 # Create a file on master and change it on branch
27 test_expect_success PERL 'setup' '
28 echo master >file &&
@@ -296,24 +286,24 @@ test_expect_success PERL 'setup with 2 files different' '
286 test_expect_success PERL 'say no to the first file' '
287 (echo n && echo) >input &&
288 git difftool -x cat branch <input >output &&
299 - stdin_contains m2 <output &&
300 - stdin_contains br2 <output &&
301 - stdin_doesnot_contain master <output &&
302 - stdin_doesnot_contain branch <output
289 + grep m2 output &&
290 + grep br2 output &&
291 + ! grep master output &&
292 + ! grep branch output
293 '
294
295 test_expect_success PERL 'say no to the second file' '
296 (echo && echo n) >input &&
297 git difftool -x cat branch <input >output &&
308 - stdin_contains master <output &&
309 - stdin_contains branch <output &&
310 - stdin_doesnot_contain m2 <output &&
311 - stdin_doesnot_contain br2 <output
298 + grep master output &&
299 + grep branch output &&
300 + ! grep m2 output &&
301 + ! grep br2 output
302 '
303
304 test_expect_success PERL 'difftool --tool-help' '
305 git difftool --tool-help >output &&
316 - stdin_contains tool <output
306 + grep tool output
307 '
308
309 test_expect_success PERL 'setup change in subdirectory' '
@@ -330,28 +320,28 @@ test_expect_success PERL 'setup change in subdirectory' '
320
321 test_expect_success PERL 'difftool -d' '
322 git difftool -d --extcmd ls branch >output &&
333 - stdin_contains sub <output &&
334 - stdin_contains file <output
323 + grep sub output &&
324 + grep file output
325 '
326
327 test_expect_success PERL 'difftool --dir-diff' '
328 git difftool --dir-diff --extcmd ls branch >output &&
339 - stdin_contains sub <output &&
340 - stdin_contains file <output
329 + grep sub output &&
330 + grep file output
331 '
332
333 test_expect_success PERL 'difftool --dir-diff ignores --prompt' '
334 git difftool --dir-diff --prompt --extcmd ls branch >output &&
345 - stdin_contains sub <output &&
346 - stdin_contains file <output
335 + grep sub output &&
336 + grep file output
337 '
338
339 test_expect_success PERL 'difftool --dir-diff from subdirectory' '
340 (
341 cd sub &&
342 git difftool --dir-diff --extcmd ls branch >output &&
353 - stdin_contains sub <output &&
354 - stdin_contains file <output
343 + grep sub output &&
344 + grep file output
345 )
346 '
347