Thread (1 message) 1 message, 1 author, 2016-06-15

Re: difftool--helper: exit when reading a prompt answer fails

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:48

David Aguilar [off-list ref] writes:
quoted
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index dc30a51..9cf5dc9 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
 	! grep br2 output
 '
 
+test_expect_success PERL 'ending prompt input with EOF' '
+	git difftool -x cat branch </dev/null >output &&
+	! grep master output &&
+	! grep branch output &&
+	! grep m2 output &&
+	! grep br2 output
+'
Should we use "test_must_fail grep ..." instead of "! grep ..." here?
NO.  We do not expect system-supplied "grep" to dump core and
declare it as a test failure.  test_must_fail is for catching an
expected non-zero status exit from git commands, i.e. when we expect
our binary to correctly notice some condition and report that fact
with non-zero exit status, we do not want to mistake the binary
segfaulting as working correctly.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help