git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/5] t4124: move test preparation into the test context

From
Rubén Justo <rjusto@gmail.com>
Date
Aug 25, 2024, 10:19 UTC
Message-ID
<4c0c05a2-c143-43b4-bc1b-d70b3645c702@gmail.com>
In-Reply-To
<6dd964c2-9dee-4257-8f1a-5bc31a73722e@gmail.com>
Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
 t/t4124-apply-ws-rule.sh | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index e12b8333c3..56f15dc3ef 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -423,14 +423,8 @@ test_expect_success 'missing blanks at EOF must only match blank lines' '
 	test_must_fail git apply --ignore-space-change --whitespace=fix patch
 '
 
-sed -e's/Z//' >one <<EOF
-a
-b
-c
-		      Z
-EOF
-
 test_expect_success 'missing blank line should match context line with spaces' '
+	test_write_lines a b c "		      " >one &&
 	git add one &&
 	echo d >>one &&
 	git diff -- one >patch &&
@@ -443,14 +437,8 @@ test_expect_success 'missing blank line should match context line with spaces' '
 	test_cmp expect one
 '
 
-sed -e's/Z//' >one <<EOF
-a
-b
-c
-		      Z
-EOF
-
 test_expect_success 'same, but with the --ignore-space-option' '
+	test_write_lines a b c "		      " >one &&
 	git add one &&
 	echo d >>one &&
 	cp one expect &&
-- 
2.46.0.353.g385c909849
Previous: Junio C Hamano
Message 18 of 18 in “`--whitespace=fix` with `--no-ignore-whitespace`”
  1. 0/5 `--whitespace=fix` with `--no-ignore-whitespace`Rubén Justo, Aug 25, 2024
  2. 1/5 apply: introduce `ignore_ws_default`Rubén Justo, Aug 25, 2024
  3. Junio C HamanoAug 27, 2024
  4. 2/5 apply: honor `ignore_ws_none` with `correct_ws_error`Rubén Justo, Aug 25, 2024
  5. Junio C HamanoAug 27, 2024
  6. Rubén JustoAug 29, 2024
  7. Junio C HamanoAug 29, 2024
  8. Rubén JustoSep 3, 2024
  9. Junio C HamanoSep 4, 2024
  10. Rubén JustoSep 4, 2024
  11. 3/5 apply: whitespace errors in context lines if we haveRubén Justo, Aug 25, 2024
  12. Junio C HamanoAug 27, 2024
  13. Junio C HamanoAug 27, 2024
  14. Junio C HamanoAug 27, 2024
  15. Junio C HamanoAug 27, 2024
  16. 4/5 apply: error message in `record_ws_error()`Rubén Justo, Aug 25, 2024
  17. Junio C HamanoAug 27, 2024
  18. 5/5 t4124: move test preparation into the test contextRubén Justo, Aug 25, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.