git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Taylor Blau <me@ttaylorr.com>, Eric Sunshine <sunshine@sunshineco.com>
Subject: [PATCH v2 06/10] t3404: work around platform-specific behaviour on macOS 10.15
Date: Tue, 15 Oct 2024 13:45:23 +0200	[thread overview]
Message-ID: <1daadd82766a59577580dc386b91a942b0df6e15.1728992306.git.ps@pks.im> (raw)
In-Reply-To: <cover.1728992306.git.ps@pks.im>

Two of our tests in t3404 use indented HERE docs where leading tabs on
some of the lines are actually relevant. The tabs do get removed though,
and we try to fix this up by using sed(1) to replace leading tabs in the
actual output, as well. But macOS 10.15 uses an oldish version of sed(1)
that has BSD lineage, which does not understand "\t", and thus we fail
to strip those leading tabs and fail the test.

Address this issue by using `q_to_tab` such that we do not have to strip
leading tabs from the actual output.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/t3404-rebase-interactive.sh | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index f171af3061d..7ce75237803 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1917,18 +1917,17 @@ test_expect_success '--update-refs updates refs correctly' '
 	test_cmp_rev HEAD~1 refs/heads/third &&
 	test_cmp_rev HEAD refs/heads/no-conflict-branch &&
 
-	cat >expect <<-\EOF &&
+	q_to_tab >expect <<-\EOF &&
 	Successfully rebased and updated refs/heads/update-refs.
 	Updated the following refs with --update-refs:
-		refs/heads/first
-		refs/heads/no-conflict-branch
-		refs/heads/second
-		refs/heads/third
+	Qrefs/heads/first
+	Qrefs/heads/no-conflict-branch
+	Qrefs/heads/second
+	Qrefs/heads/third
 	EOF
 
 	# Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
-	sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
-		<err >err.trimmed &&
+	sed "s/Rebasing.*Successfully/Successfully/g" <err >err.trimmed &&
 	test_cmp expect err.trimmed
 '
 
@@ -2178,19 +2177,18 @@ test_expect_success '--update-refs: check failed ref update' '
 	test_must_fail git rebase --continue 2>err &&
 	grep "update_ref failed for ref '\''refs/heads/second'\''" err &&
 
-	cat >expect <<-\EOF &&
+	q_to_tab >expect <<-\EOF &&
 	Updated the following refs with --update-refs:
-		refs/heads/first
-		refs/heads/no-conflict-branch
-		refs/heads/third
+	Qrefs/heads/first
+	Qrefs/heads/no-conflict-branch
+	Qrefs/heads/third
 	Failed to update the following refs with --update-refs:
-		refs/heads/second
+	Qrefs/heads/second
 	EOF
 
 	# Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
 	tail -n 6 err >err.last &&
-	sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
-		<err.last >err.trimmed &&
+	sed "s/Rebasing.*Successfully/Successfully/g" <err.last >err.trimmed &&
 	test_cmp expect err.trimmed
 '
 
-- 
2.47.0.72.gef8ce8f3d4.dirty


  parent reply	other threads:[~2024-10-15 11:45 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 12:21 [PATCH 00/10] Platform compatibility fixes Patrick Steinhardt
2024-10-14 12:21 ` [PATCH 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE Patrick Steinhardt
2024-10-14 22:00   ` Taylor Blau
2024-10-14 12:21 ` [PATCH 02/10] t/test-lib: wire up NO_ICONV prerequisite Patrick Steinhardt
2024-10-14 12:21 ` [PATCH 03/10] t/lib-gitweb: test against the build version of gitweb Patrick Steinhardt
2024-10-14 22:06   ` Taylor Blau
2024-10-15 11:36     ` Patrick Steinhardt
2024-10-14 12:21 ` [PATCH 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW Patrick Steinhardt
2024-10-14 22:07   ` Taylor Blau
2024-10-14 12:21 ` [PATCH 05/10] t1401: make invocation of tar(1) work with Win32-provided one Patrick Steinhardt
2024-10-14 23:23   ` Eric Sunshine
2024-10-15  0:29     ` Taylor Blau
2024-10-14 12:21 ` [PATCH 06/10] t3404: work around platform-specific behaviour on macOS 10.15 Patrick Steinhardt
2024-10-14 12:21 ` [PATCH 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin Patrick Steinhardt
2024-10-14 22:10   ` Taylor Blau
2024-10-14 12:21 ` [PATCH 08/10] t7300: work around platform-specific behaviour with long paths on MinGW Patrick Steinhardt
2024-10-14 12:21 ` [PATCH 09/10] builtin/credential-cache: fix missing parameter for stub function Patrick Steinhardt
2024-10-14 22:12   ` Taylor Blau
2024-10-14 12:21 ` [PATCH 10/10] http: fix build error on FreeBSD Patrick Steinhardt
2024-10-14 22:14   ` Taylor Blau
2024-10-15 11:44     ` Patrick Steinhardt
2024-10-15 11:45 ` [PATCH v2 00/10] Platform compatibility fixes Patrick Steinhardt
2024-10-15 11:45   ` [PATCH v2 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE Patrick Steinhardt
2024-10-15 11:45   ` [PATCH v2 02/10] t/test-lib: wire up NO_ICONV prerequisite Patrick Steinhardt
2024-10-15 23:53     ` Taylor Blau
2024-10-16  3:57       ` Patrick Steinhardt
2024-10-16 20:59         ` Taylor Blau
2024-10-16 21:02           ` Taylor Blau
2024-10-17  4:03             ` Patrick Steinhardt
2024-10-15 11:45   ` [PATCH v2 03/10] t/lib-gitweb: test against the build version of gitweb Patrick Steinhardt
2024-10-15 11:45   ` [PATCH v2 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW Patrick Steinhardt
2024-10-16  5:59     ` James Liu
2024-10-15 11:45   ` [PATCH v2 05/10] t1401: make invocation of tar(1) work with Win32-provided one Patrick Steinhardt
2024-10-16  5:58     ` James Liu
2024-10-15 11:45   ` Patrick Steinhardt [this message]
2024-10-16  6:02     ` [PATCH v2 06/10] t3404: work around platform-specific behaviour on macOS 10.15 James Liu
2024-10-15 11:45   ` [PATCH v2 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin Patrick Steinhardt
2024-10-15 11:45   ` [PATCH v2 08/10] t7300: work around platform-specific behaviour with long paths on MinGW Patrick Steinhardt
2024-10-16  6:35     ` James Liu
2024-10-16  8:27       ` James Liu
2024-10-15 11:45   ` [PATCH v2 09/10] builtin/credential-cache: fix missing parameter for stub function Patrick Steinhardt
2024-10-15 11:45   ` [PATCH v2 10/10] http: fix build error on FreeBSD Patrick Steinhardt
2024-10-16  8:12 ` [PATCH v3 00/10] Platform compatibility fixes Patrick Steinhardt
2024-10-16  8:12   ` [PATCH v3 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE Patrick Steinhardt
2024-10-16  8:12   ` [PATCH v3 02/10] t/test-lib: wire up NO_ICONV prerequisite Patrick Steinhardt
2024-10-17  1:10     ` brian m. carlson
2024-10-17  4:03       ` Patrick Steinhardt
2024-10-25 18:32     ` Josh Steadmon
2024-10-28  5:14       ` [PATCH] t6006: fix prereq handling with `test_format ()` Patrick Steinhardt
2024-10-28 17:48         ` Taylor Blau
2024-10-16  8:12   ` [PATCH v3 03/10] t/lib-gitweb: test against the build version of gitweb Patrick Steinhardt
2024-10-16  8:12   ` [PATCH v3 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW Patrick Steinhardt
2024-10-16  8:13   ` [PATCH v3 05/10] t1401: make invocation of tar(1) work with Win32-provided one Patrick Steinhardt
2024-10-16  8:13   ` [PATCH v3 06/10] t3404: work around platform-specific behaviour on macOS 10.15 Patrick Steinhardt
2024-10-16  8:13   ` [PATCH v3 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin Patrick Steinhardt
2024-10-16  8:13   ` [PATCH v3 08/10] t7300: work around platform-specific behaviour with long paths on MinGW Patrick Steinhardt
2024-10-16  8:13   ` [PATCH v3 09/10] builtin/credential-cache: fix missing parameter for stub function Patrick Steinhardt
2024-10-16  8:13   ` [PATCH v3 10/10] http: fix build error on FreeBSD Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1daadd82766a59577580dc386b91a942b0df6e15.1728992306.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).