Thread (16 messages) flat view 16 messages, 3 authors, 2016-06-15

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:50:00

On Sun, Oct 31, 2010 at 08:33, Jonathan Nieder [off-list ref] wrote:
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 output
In an earlier thread I suggested an interface like:

    test_line_count 3 "git ls-files -u B"

But I like yours much better. Ack.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help