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

Re: [PATCH v6 2/2] test-config: Add tests for the config_set API

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 7, 2014, 17:04 UTC
Message-ID
<vpqvbr9w154.fsf@anie.imag.fr>
In-Reply-To
<1404719566-3368-3-git-send-email-tanayabh@gmail.com>
Tanay Abhra <tanayabh@gmail.com> writes:
Show 9 quoted lines
> diff --git a/t/t1308-config-hash.sh b/t/t1308-config-hash.sh
> new file mode 100755
> index 0000000..ad99f8b
> --- /dev/null
> +++ b/t/t1308-config-hash.sh
> @@ -0,0 +1,168 @@
> +#!/bin/sh
> +
> +test_description='Test git config-hash API in different settings'
You may want to call it "config_set API" now.
> +#'check section.key value' verifies that the entry for section.key is
> +#'value'
Style: space after #.
Show 5 quoted lines
> +check() {
> +	echo "$2" >expected
> +	test-config get_value "$1" >actual 2>&1
> +	test_cmp actual expected
> +}

You need to &&-chain these lines, to catch potential test-config failures (if it returns 1 after sending the right output, you won't notice).

The doc says
 - test_cmp <expected> <actual>
You swapped the order of parameters.
> +test_expect_success 'setup default config' '
> +	cat >.git/config << EOF
Missing && here (sorry, I should have noticed the first time).
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Tanay AbhraNext: Tanay Abhra
Message 4 of 7 in “git config cache & special querying api utilizing the cache”
  1. 0/3 git config cache & special querying api utilizing the cacheTanay Abhra, Jul 7, 2014
  2. 1/2 add `config_set` API for caching config-like filesTanay Abhra, Jul 7, 2014
  3. 2/2 test-config: Add tests for the config_set APITanay Abhra, Jul 7, 2014
  4. Matthieu MoyJul 7, 2014
  5. Tanay AbhraJul 9, 2014
  6. Matthieu MoyJul 9, 2014
  7. Matthieu MoyJul 7, 2014

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.