git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2024, 02:18 UTC
Message-ID
<xmqq8r2l1rot.fsf@gitster.g>
In-Reply-To
<292ab942c38de44476c6c5bf045c375bf4f6a70d.1710258538.git.dsimic@manjaro.org>
Dragan Simic <dsimic@manjaro.org> writes:
> 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.

While this may document the current behaviour, I am not sure of the value of carving the current behaviour in stone, especially after checking if the current behaviour is a bug.

Show 36 quoted lines
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
>  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
>  '
Previous: Dragan SimicNext: Dragan Simic
Message 13 of 14 in “Improve the documentation and test coverage for whitespace and comments”
  1. 0/3 Improve the documentation and test coverage for whitespace and commentsDragan Simic, Mar 12, 2024
  2. 2/3 config.txt: perform some minor reformattingDragan Simic, Mar 12, 2024
  3. Junio C HamanoMar 14, 2024
  4. Dragan SimicMar 14, 2024
  5. Junio C HamanoMar 14, 2024
  6. Dragan SimicMar 14, 2024
  7. 1/3 config.txt: describe whitespace characters further and more accuratelyDragan Simic, Mar 12, 2024
  8. Junio C HamanoMar 14, 2024
  9. Dragan SimicMar 14, 2024
  10. Junio C HamanoMar 14, 2024
  11. Dragan SimicMar 14, 2024
  12. 3/3 t1300: add tests for internal whitespace and inline commentsDragan Simic, Mar 12, 2024
  13. Junio C HamanoMar 14, 2024
  14. Dragan SimicMar 14, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.