From: Dragan Simic <dsimic@manjaro.org>
To: git@vger.kernel.org
Subject: [PATCH 3/3] t4047: whitespace in diff.dirstat and --dirstat
Date: Tue, 2 Apr 2024 02:13:44 +0200 [thread overview]
Message-ID: <09d6260ffb717dd85ce6f041402ed9a5e1cfe039.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.dirstat" configuration option and the "--dirstat"
command-line option.
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---
t/t4047-diff-dirstat.sh | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh
index 7b73462d53d2..715b3579539e 100755
--- a/t/t4047-diff-dirstat.sh
+++ b/t/t4047-diff-dirstat.sh
@@ -707,24 +707,42 @@ test_expect_success '--dirstat-by-file --cumulative' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
-test_expect_success '--dirstat=files,cumulative' '
+test_expect_success '--dirstat=files,cumulative with no spaces' '
git diff --dirstat=files,cumulative HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git diff --dirstat=files,cumulative -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git diff --dirstat=files,cumulative -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
-test_expect_success 'diff.dirstat=cumulative,files' '
+test_expect_success '--dirstat=files,cumulative with spaces' '
+ git diff --dirstat="files, cumulative" HEAD^..HEAD >actual_diff_dirstat &&
+ test_cmp expect_diff_dirstat actual_diff_dirstat &&
+ git diff --dirstat="files , cumulative" -M HEAD^..HEAD >actual_diff_dirstat_M &&
+ test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
+ git diff --dirstat=" files , cumulative " -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
+ test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
+'
+
+test_expect_success 'diff.dirstat=cumulative,files with no spaces' '
git -c diff.dirstat=cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
+test_expect_success 'diff.dirstat=cumulative,files with spaces' '
+ git -c "diff.dirstat= cumulative,files " diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
+ test_cmp expect_diff_dirstat actual_diff_dirstat &&
+ git -c "diff.dirstat= cumulative ,files" diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
+ test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
+ git -c "diff.dirstat= cumulative , files" diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
+ test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
+'
+
cat <<EOF >expect_diff_dirstat
27.2% dst/copy/
27.2% dst/move/
@@ -766,15 +784,24 @@ test_expect_success '--dirstat=files,cumulative,10' '
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
-test_expect_success 'diff.dirstat=10,cumulative,files' '
+test_expect_success 'diff.dirstat=10,cumulative,files with no spaces' '
git -c diff.dirstat=10,cumulative,files diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
test_cmp expect_diff_dirstat actual_diff_dirstat &&
git -c diff.dirstat=10,cumulative,files diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
git -c diff.dirstat=10,cumulative,files diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
'
+test_expect_success 'diff.dirstat=10,cumulative,files with spaces' '
+ git -c "diff.dirstat= 10,cumulative,files " diff --dirstat HEAD^..HEAD >actual_diff_dirstat &&
+ test_cmp expect_diff_dirstat actual_diff_dirstat &&
+ git -c "diff.dirstat=10, cumulative, files" diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M &&
+ test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
+ git -c "diff.dirstat=10 , cumulative , files" diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
+ test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
+'
+
cat <<EOF >expect_diff_dirstat
27.2% dst/copy/
27.2% dst/move/
next prev 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 ` [PATCH 2/3] t4015: whitespace in diff.wsErrorHighlight and --ws-error-highlight Dragan Simic
2024-04-02 0:13 ` Dragan Simic [this message]
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=09d6260ffb717dd85ce6f041402ed9a5e1cfe039.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).