Re: [PATCH v6 2/2] test-config: Add tests for the config_set API
Tanay Abhra writes: > On 7/7/2014 10:34 PM, Matthieu Moy wrote: >> Tanay Abhra writes: >> >>> diff --git a/t/t1308-config-hash.sh b/t/t1308-config-hash.sh >>> new file mode 100755 >>> index 000..ad99f8b >>> --- /dev/null >>> +++ b/t/t1308-config-hash.sh >>> +test_expect_success 'setup default config' ' >>> + cat >.git/config << EOF >> >> Missing && here (sorry, I should have noticed the first time). >> > > Does a single cat command warrant a `&&`? It errors out when I try > to add it there. Ahh, my bad, I didn't notice that cat was the only command in the test. You're right, no && needed or possible here. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 2/2] test-config: Add tests for the config_set API
On 7/7/2014 10:34 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> diff --git a/t/t1308-config-hash.sh b/t/t1308-config-hash.sh >> new file mode 100755 >> index 000..ad99f8b >> --- /dev/null >> +++ b/t/t1308-config-hash.sh >> +test_expect_success 'setup default config' ' >> +cat >.git/config << EOF > > Missing && here (sorry, I should have noticed the first time). > Does a single cat command warrant a `&&`? It errors out when I try to add it there. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 2/2] test-config: Add tests for the config_set API
Tanay Abhra writes: > diff --git a/t/t1308-config-hash.sh b/t/t1308-config-hash.sh > new file mode 100755 > index 000..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 #. > +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 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/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html