]> git.ipfire.org Git - thirdparty/git.git/commit
test-lib-functions: introduce test_stdout_line_count
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Sun, 4 Jul 2021 05:46:10 +0000 (12:46 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Jul 2021 19:22:27 +0000 (12:22 -0700)
commitcdff1bb5a3d6f0e6bf26d8ff088a0e10b40bc4f3
tree18ca6fab2e667f160d245f776e0bc108287672c2
parent670b81a890388c60b7032a4f5b879f2ece8c4558
test-lib-functions: introduce test_stdout_line_count

In some tests, we're checking the number of lines in output of some
commands, including but not limited to Git's command.

We're doing the check by running those commands in the left side of
a pipe, thus losing the exit status code of those commands. Meanwhile,
we really want to check the exit status code of Git's command.

Let's write the output of those commands to a temporary file, and use
test_line_count separately in order to check exit status code of
those commands properly.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib-functions.sh