Re: [RFC/PATCH 02/10] test-lib: introduce test_line_count to measure files
On Sun, Oct 31, 2010 at 08:33, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 15 quoted lines
> Some tests check their output with code like the following:
>
> test "$(git ls-files -u B | wc -l)" -eq 3 || {
> echo "BAD: should have left stages for B"
> return 1
> }
>
> The verbose failure condition is used because test, unlike
> diff, does not print any useful information about the
> nature of the failure when it fails.
>
> Introduce a test_line_count function to help. If used like
>
> git ls-files -u B >output &&
> test_line_count -eq 3 outputIn an earlier thread I suggested an interface like:
test_line_count 3 "git ls-files -u B"
But I like yours much better. Ack.