@@ -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 \
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(-)