diff mbox series

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

Message ID 4c0c05a2-c143-43b4-bc1b-d70b3645c702@gmail.com (mailing list archive)
State New
Headers show
Series `--whitespace=fix` with `--no-ignore-whitespace` | expand

Commit Message

Rubén Justo Aug. 25, 2024, 10:19 a.m. UTC
Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
 t/t4124-apply-ws-rule.sh | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
diff mbox series

Patch

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 &&