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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Chained by &&, I presume.

> With such a helper function this could be reduced to a single line:
> 
>   test_string_equal "(master)" "$(__git_ps1)"
> 
> without loss of functionality

Not quite: A non-zero exit code of the $(__git_ps1) is lost. (It
probably doesn't matter here, but it certainly does if the command is
$(git rev-parse foo) or similar.)

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]