Re: [RFC/PATCH 02/10] test-lib: introduce test_line_count to measure files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 9, 2010, 22:56 UTC
- Message-ID
- <7veiaukswn.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20101031073350.GC11483@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 12 quoted lines
> 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.