Skip to content

Commit

Permalink
t4124: move test preparation into the test context
Browse files Browse the repository at this point in the history
Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
rjusto authored and gitster committed Aug 25, 2024
1 parent 5374cca commit 4bba000
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions t/t4124-apply-ws-rule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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 &&
Expand Down

0 comments on commit 4bba000

Please sign in to comment.