[PATCH 2/3] t4015: whitespace in diff.wsErrorHighlight and --ws-error-highlight

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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 \




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux