All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: git@vger.kernel.org
Subject: [PATCH 2/3] t4015: whitespace in diff.wsErrorHighlight and --ws-error-highlight
Date: Tue,  2 Apr 2024 02:13:43 +0200	[thread overview]
Message-ID: <cc9d9e561d7cf49eb9d43e8351f9dd9509792af0.1712016667.git.dsimic@manjaro.org> (raw)
In-Reply-To: <cover.1712016667.git.dsimic@manjaro.org>

Add a few more tests to cover the support for optional placing of additional
whitespace characters around the commas in the multi-value, comma-separated
values for the "diff.wsErrorHighlight" configuration option and the
"--ws-error-highlight" command-line option.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---
 t/t4015-diff-whitespace.sh | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index b443626afd72..22f4f3bba7f1 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -1088,7 +1088,7 @@ test_expect_success 'ws-error-highlight test setup' '
 
 '
 
-test_expect_success 'test --ws-error-highlight option' '
+test_expect_success 'test --ws-error-highlight option with no spaces' '
 
 	git diff --color --ws-error-highlight=default,old >current.raw &&
 	test_decode_color <current.raw >current &&
@@ -1104,7 +1104,23 @@ test_expect_success 'test --ws-error-highlight option' '
 
 '
 
-test_expect_success 'test diff.wsErrorHighlight config' '
+test_expect_success 'test --ws-error-highlight option with spaces' '
+
+	git diff --color --ws-error-highlight="default, old" >current.raw &&
+	test_decode_color <current.raw >current &&
+	test_cmp expect.default-old current &&
+
+	git diff --color --ws-error-highlight="default , old" >current.raw &&
+	test_decode_color <current.raw >current &&
+	test_cmp expect.default-old current &&
+
+	git diff --color --ws-error-highlight=" default , old " >current.raw &&
+	test_decode_color <current.raw >current &&
+	test_cmp expect.default-old current
+
+'
+
+test_expect_success 'test diff.wsErrorHighlight config with no spaces' '
 
 	git -c diff.wsErrorHighlight=default,old diff --color >current.raw &&
 	test_decode_color <current.raw >current &&
@@ -1120,6 +1136,22 @@ test_expect_success 'test diff.wsErrorHighlight config' '
 
 '
 
+test_expect_success 'test diff.wsErrorHighlight config with spaces' '
+
+	git -c "diff.wsErrorHighlight=default, old" diff --color >current.raw &&
+	test_decode_color <current.raw >current &&
+	test_cmp expect.default-old current &&
+
+	git -c "diff.wsErrorHighlight=default , old" diff --color >current.raw &&
+	test_decode_color <current.raw >current &&
+	test_cmp expect.default-old current &&
+
+	git -c "diff.wsErrorHighlight= default , old " diff --color >current.raw &&
+	test_decode_color <current.raw >current &&
+	test_cmp expect.default-old current
+
+'
+
 test_expect_success 'option overrides diff.wsErrorHighlight' '
 
 	git -c diff.wsErrorHighlight=none \

  parent reply	other threads:[~2024-04-02  0:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02  0:13 [PATCH 0/3] Make support for multi-value configuration options more consistent Dragan Simic
2024-04-02  0:13 ` [PATCH 1/3] diff: support additional whitespace in diff.{dirstat,wsErrorHighlight} Dragan Simic
2024-04-02  0:13 ` Dragan Simic [this message]
2024-04-02  0:13 ` [PATCH 3/3] t4047: whitespace in diff.dirstat and --dirstat Dragan Simic
2024-04-02  0:31 ` [PATCH 0/3] Make support for multi-value configuration options more consistent Dragan Simic
2024-04-16  5:40 ` Dragan Simic

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=cc9d9e561d7cf49eb9d43e8351f9dd9509792af0.1712016667.git.dsimic@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.