git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH RESEND] t4015: improve coverage of function context test
@ 2019-12-18 18:05 René Scharfe
  2019-12-18 20:12 ` Jeff King
  2019-12-19 17:35 ` [PATCH v2] " René Scharfe
  0 siblings, 2 replies; 5+ messages in thread
From: René Scharfe @ 2019-12-18 18:05 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Jeff King, Junio C Hamano, Derrick Stolee, Eric Sunshine

Include an actual function line in the test files to check if context is
expanded to include the whole function, and add an ignored change before
function context to check if that one stays hidden, while the originally
ignored change within function context is shown.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
Original submission:
https://lore.kernel.org/git/e47b77b4-7b7a-3d59-9e24-934528c5e297@web.de/

 t/t4015-diff-whitespace.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 65615e2fa9..59b2412c22 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -2051,19 +2051,24 @@ test_expect_success 'compare mixed whitespace delta across moved blocks' '
 '

 test_expect_success 'combine --ignore-blank-lines with --function-context' '
-	test_write_lines 1 "" 2 3 4 5 >a &&
-	test_write_lines 1    2 3 4   >b &&
+	test_write_lines    1 2 3 "" function 1 2 3 4 5 "" 6 7 8 9 >a &&
+	test_write_lines "" 1 2 3 "" function 1 2 3 4 5    6 7 8   >b &&
 	test_must_fail git diff --no-index \
 		--ignore-blank-lines --function-context a b >actual.raw &&
 	sed -n "/@@/,\$p" <actual.raw >actual &&
 	cat <<-\EOF >expect &&
-	@@ -1,6 +1,4 @@
+	@@ -5,11 +6,9 @@
+	 function
 	 1
-	-
 	 2
 	 3
 	 4
-	-5
+	 5
+	-
+	 6
+	 7
+	 8
+	-9
 	EOF
 	test_cmp expect actual
 '
--
2.24.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-19 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 18:05 [PATCH RESEND] t4015: improve coverage of function context test René Scharfe
2019-12-18 20:12 ` Jeff King
2019-12-19 17:35   ` René Scharfe
2019-12-19 17:35 ` [PATCH v2] " René Scharfe
2019-12-19 17:51   ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).