Re: [RFC/PATCH 02/10] test-lib: introduce test_line_count to measure files

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

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> Introduce a test_line_count function to help. If used like
>
> 	git ls-files -u B >output &&
> 	test_line_count -eq 3 output
>
> it will produce output like
>
> 	test_line_count: line count for output !-eq 3
> 	100644 b023018cabc396e7692c70bbf5784a93d3f738ab 2	hi.c
> 	100644 45b983be36b73c0788dc9cbcb76cbb80fc7bb057 3	hi.c
>
> on failure.

Sounds like a sane thing to do.

Especially because you wrote the implementation without surrounding dq
pair, the callers can say "test_line_count = $N $file" instead of -eq and
things will not break.  Nice.


--
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]