Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread Jeff King
On Sun, Jun 09, 2013 at 11:30:01AM -0700, Junio C Hamano wrote: > -- >8 -- > Subject: [PATCH] test: test_output_must_be_empty helper > > There are quite a lot places where an output file is expected to be > empty, and we fail the test when it is not. The output from running > the test script wit

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread SZEDER Gábor
On Mon, Jun 10, 2013 at 09:07:06PM +0200, Johannes Sixt wrote: > Am 10.06.2013 19:27, schrieb SZEDER Gábor: > > My main motivation is that, like in your example, in the bash prompt > > tests I only have to check a single line of output, but because of > > debuggability I always did: > > > > echo

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread Junio C Hamano
SZEDER Gábor writes: > With such a helper function this could be reduced to a single line: > > test_string_equal "(master)" "$(__git_ps1)" > > without loss of functionality or debuggability, because in case of a > failure it would output something like this (bikesheddable, of > course): > > E

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread Johannes Sixt
Am 10.06.2013 19:27, schrieb SZEDER Gábor: > My main motivation is that, like in your example, in the bash prompt > tests I only have to check a single line of output, but because of > debuggability I always did: > > echo "(master)" >expected > __git_ps1 >actual > test_cmp expected actual C

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread SZEDER Gábor
On Mon, Jun 10, 2013 at 08:56:58AM -0700, Junio C Hamano wrote: > SZEDER Gábor writes: > > > On Sun, Jun 09, 2013 at 03:41:54PM -0500, Felipe Contreras wrote: > >> There > >> will not be a need for test_string_must_be_empty() just like there's > >> no need for test_string_cmp(). > > > > Actually,

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread Felipe Contreras
On Mon, Jun 10, 2013 at 10:56 AM, Junio C Hamano wrote: > By the way, test_cmp() is a replacement for the "cmp" command and > that is why it does not have "file" in its name. That's an irrelevant implementation detail. But if you want to be driven the the implementation, call it test_zero(). --

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread Junio C Hamano
SZEDER Gábor writes: > On Sun, Jun 09, 2013 at 03:41:54PM -0500, Felipe Contreras wrote: >> There >> will not be a need for test_string_must_be_empty() just like there's >> no need for test_string_cmp(). > > Actually, if there were a test_string_cmp(), that would be the test > helper function I u

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-10 Thread SZEDER Gábor
On Sun, Jun 09, 2013 at 03:41:54PM -0500, Felipe Contreras wrote: > There > will not be a need for test_string_must_be_empty() just like there's > no need for test_string_cmp(). Actually, if there were a test_string_cmp(), that would be the test helper function I used most often. -- To unsubscrib

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Junio C Hamano
"Philip Oakley" writes: > While folks do use such simplistic names, given that the patch had > many call sites, I do think Filipe's short name would quickly become > the accepted test name and not cause any great difficulties. OK. -- To unsubscribe from this list: send the line "unsubscribe git"

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Philip Oakley
From: "Felipe Contreras" Sent: Sunday, June 09, 2013 8:33 PM On Sun, Jun 9, 2013 at 2:20 PM, Junio C Hamano wrote: Felipe Contreras writes: On Sun, Jun 9, 2013 at 1:30 PM, Junio C Hamano wrote: --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -606,6 +606,18 @@ test_cmp() {

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Felipe Contreras
On Sun, Jun 9, 2013 at 3:35 PM, Junio C Hamano wrote: > Felipe Contreras writes: > >> On Sun, Jun 9, 2013 at 2:20 PM, Junio C Hamano wrote: >>> Felipe Contreras writes: >>> On Sun, Jun 9, 2013 at 1:30 PM, Junio C Hamano wrote: > --- a/t/test-lib-functions.sh > +++ b/t/test-li

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Junio C Hamano
Felipe Contreras writes: > On Sun, Jun 9, 2013 at 2:20 PM, Junio C Hamano wrote: >> Felipe Contreras writes: >> >>> On Sun, Jun 9, 2013 at 1:30 PM, Junio C Hamano wrote: >>> --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -606,6 +606,18 @@ test_cmp() {

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Felipe Contreras
On Sun, Jun 9, 2013 at 2:20 PM, Junio C Hamano wrote: > Felipe Contreras writes: > >> On Sun, Jun 9, 2013 at 1:30 PM, Junio C Hamano wrote: >> >>> --- a/t/test-lib-functions.sh >>> +++ b/t/test-lib-functions.sh >>> @@ -606,6 +606,18 @@ test_cmp() { >>> $GIT_TEST_CMP "$@" >>> } >>> >>> +

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Junio C Hamano
Felipe Contreras writes: > On Sun, Jun 9, 2013 at 1:30 PM, Junio C Hamano wrote: > >> --- a/t/test-lib-functions.sh >> +++ b/t/test-lib-functions.sh >> @@ -606,6 +606,18 @@ test_cmp() { >> $GIT_TEST_CMP "$@" >> } >> >> +# Check if the file expected to be empty is indeed empty, and barfs

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Felipe Contreras
On Sun, Jun 9, 2013 at 1:30 PM, Junio C Hamano wrote: > --- a/t/test-lib-functions.sh > +++ b/t/test-lib-functions.sh > @@ -606,6 +606,18 @@ test_cmp() { > $GIT_TEST_CMP "$@" > } > > +# Check if the file expected to be empty is indeed empty, and barfs > +# otherwise. > + > +test_output_m

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-09 Thread Junio C Hamano
Duy Nguyen writes: > On Sat, Jun 8, 2013 at 3:32 AM, Felipe Contreras > wrote: >> Let's show the output so it's clear why it failed. > > I think you can always look into trash-directory.t3400 and figure why. > But if you show this, I think you should use test_cmp to make it clear > what is not w

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-08 Thread Felipe Contreras
On Fri, Jun 7, 2013 at 9:44 PM, Duy Nguyen wrote: > On Sat, Jun 8, 2013 at 3:32 AM, Felipe Contreras > wrote: >> Let's show the output so it's clear why it failed. > > I think you can always look into trash-directory.t3400 and figure why. > But if you show this, I think you should use test_cmp to

Re: [PATCH 2/3] test: improve rebase -q test

2013-06-07 Thread Duy Nguyen
On Sat, Jun 8, 2013 at 3:32 AM, Felipe Contreras wrote: > Let's show the output so it's clear why it failed. I think you can always look into trash-directory.t3400 and figure why. But if you show this, I think you should use test_cmp to make it clear what is not wanted. Something like : >expecte