Thread (4 messages) read the whole thread 4 messages, 1 author, 2024-03-12
DORMANTno replies

[PATCH 3/3] t1300: add tests for internal whitespace and inline comments

From: Dragan Simic <hidden>
Date: 2024-03-12 15:56:02
Subsystem: the rest · Maintainer: Linus Torvalds

Add a couple of additional automated tests, to improve the coverage of
configuration file entries whose values contain internal whitespace, or have
an additional inline comment.

Signed-off-by: Dragan Simic <redacted>
---
 t/t1300-config.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 31c387868708..589af5e81d61 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -11,6 +11,26 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
+cat > .git/config << EOF
+[section]
+	sparse = big 		 blue
+	annotated = big blue	# to be discarded
+EOF
+
+echo 'big    blue' > expect
+
+test_expect_success 'internal whitespace' '
+	git config --get section.sparse > output &&
+	test_cmp expect output
+'
+
+echo 'big blue' > expect
+
+test_expect_success 'inline comment' '
+	git config --get section.annotated > output &&
+	test_cmp expect output
+'
+
 test_expect_success 'clear default config' '
 	rm -f .git/config
 '
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help