From: Junio C Hamano Date: Tue, 09 Nov 2010 22:56:40 GMT Subject: Re: [RFC/PATCH 02/10] test-lib: introduce test_line_count to measure files Message-ID: <7veiaukswn.fsf@alter.siamese.dyndns.org> In-Reply-To: <20101031073350.GC11483@burratino> Jonathan Nieder 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.