Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-13 Thread Samuel GROOT
On 06/09/2016 08:01 AM, Matthieu Moy wrote: Samuel GROOT writes: On 06/08/2016 06:09 PM, Junio C Hamano wrote: Samuel GROOT writes: Actually we had issues when trying to refactor send-email's email parsing loop [1]. Email

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-09 Thread Tom Russello
On 06/09/16 07:51, Matthieu Moy wrote: > Junio C Hamano writes: > >> Tom Russello writes: >> >>> +# Check if two files have the same content, non-order sensitive >>> +test_cmp_noorder () { >>> + sort $1 >$1; >> >> Here is what I think happens:

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-09 Thread Matthieu Moy
Samuel GROOT writes: > On 06/08/2016 06:09 PM, Junio C Hamano wrote: >> Samuel GROOT writes: >> >>> Actually we had issues when trying to refactor send-email's email >>> parsing loop [1]. Email addresses in output file

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-08 Thread Matthieu Moy
Junio C Hamano writes: > Tom Russello writes: > >> +# Check if two files have the same content, non-order sensitive >> +test_cmp_noorder () { >> +sort $1 >$1; > > Here is what I think happens: > > 0) the shell parses this command line; >

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-08 Thread Samuel GROOT
On 06/08/2016 06:09 PM, Junio C Hamano wrote: Samuel GROOT writes: Actually we had issues when trying to refactor send-email's email parsing loop [1]. Email addresses in output file `commandeline1` in tests weren't sorted the same way as the reference file it

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-08 Thread Junio C Hamano
Samuel GROOT writes: > Actually we had issues when trying to refactor send-email's email > parsing loop [1]. Email addresses in output file `commandeline1` in > tests weren't sorted the same way as the reference file it was > compared to. E.g.: > >

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-08 Thread Samuel GROOT
On 06/08/2016 03:07 AM, Junio C Hamano wrote: I am having a hard time guessing what prompted you to sort the output, i.e. what problem you were trying to solve. It cannot be because addresses on a list (e.g. Cc:) could come out in an indeterministic order, because the address that a test

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-07 Thread Junio C Hamano
Tom Russello writes: > +# Check if two files have the same content, non-order sensitive > +test_cmp_noorder () { > + sort $1 >$1; Here is what I think happens: 0) the shell parses this command line; 1) the shell notices that the output has to go to

[PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-07 Thread Tom Russello
Tests might fail if lines compared in text files don't have the same order. Signed-off-by: Samuel GROOT Signed-off-by: Tom RUSSELLO Signed-off-by: Matthieu MOY --- t/t9001-send-email.sh | 61