git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/4] t6402: use test_line_count_cmd to count # of lines in stdout

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 13, 2021, 03:43 UTC
Message-ID
<CAPig+cS7Xh4L3YzStoU44=217jEBtFKWja7k=mTDhuHK3HBPVw@mail.gmail.com>
In-Reply-To
<20210612042755.28342-5-congdanhqx@gmail.com>

On Sat, Jun 12, 2021 at 12:28 AM Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:

Show 8 quoted lines
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
> diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
> @@ -330,8 +320,8 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
> -       test 3 -eq "$(git ls-files -u | wc -l)" &&
> -       test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
> +       test_line_count_cmd --out = 3 git ls-files -u  &&
> +       test_line_count_cmd --out = 2 git ls-files -u dir/file-in-the-way  &&
Nit: too many spaces before `&&`: s/\s+/ /
Show 5 quoted lines
> @@ -357,8 +347,8 @@ test_expect_success 'Same as previous, but merged other way' '
> -       test 3 -eq "$(git ls-files -u | wc -l)" &&
> -       test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
> +       test_line_count_cmd --out = 3 git ls-files -u  &&
> +       test_line_count_cmd --out = 2 git ls-files -u dir/file-in-the-way  &&
Ditto.
Show 5 quoted lines
> @@ -374,8 +364,8 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge, dir not in
> -       test 3 -eq "$(git ls-files -u | wc -l)" &&
> -       test 3 -eq "$(git ls-files -u dir | wc -l)" &&
> +       test_line_count_cmd --out = 3 git ls-files -u  &&
> +       test_line_count_cmd --out = 3 git ls-files -u dir  &&
Ditto.
Show 14 quoted lines
> @@ -409,14 +399,15 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge and dir in t
> -       test 5 -eq "$(git ls-files -u | wc -l)" &&
> +       test_line_count_cmd --out = 5 git ls-files -u  &&
>         if test "$GIT_TEST_MERGE_ALGORITHM" = ort
>         then
> -               test 3 -eq "$(git ls-files -u dir~HEAD | wc -l)"
> +               test_line_count_cmd --out = 3 git ls-files -u dir~HEAD
>         else
> -               test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)"
> +               git ls-files -u dir >out &&
> +               test_line_count_cmd --out = 3 grep -v file-in-the-way out
>         fi &&
> -       test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
> +       test_line_count_cmd --out = 2 git ls-files -u dir/file-in-the-way  &&
And again.
> @@ -432,14 +423,15 @@ test_expect_success 'Same as previous, but merged other way' '
> -       test 5 -eq "$(git ls-files -u | wc -l)" &&
> +       test_line_count_cmd --out = 5 git ls-files -u  &&
Here too.
> -       test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
> +       test_line_count_cmd --out = 2 git ls-files -u dir/file-in-the-way  &&
Blorp.

And the rest of the changes suffer the same problem, so I won't continue commenting...

Previous: Đoàn Trần Công DanhNext: Đoàn Trần Công Danh
Message 9 of 22 in “t: new helper test_line_count_cmd”
  1. 0/4 t: new helper test_line_count_cmdĐoàn Trần Công Danh, Jun 12, 2021
  2. 3/4 t6400: use test_line_count_cmd to count # of lines in stdoutĐoàn Trần Công Danh, Jun 12, 2021
  3. Bagas SanjayaJun 12, 2021
  4. Đoàn Trần Công DanhJun 13, 2021
  5. Eric SunshineJun 13, 2021
  6. Đoàn Trần Công DanhJun 13, 2021
  7. 2/4 t6402: use find(1) builtin to filter instead of grepĐoàn Trần Công Danh, Jun 12, 2021
  8. 4/4 t6402: use test_line_count_cmd to count # of lines in stdoutĐoàn Trần Công Danh, Jun 12, 2021
  9. Eric SunshineJun 13, 2021
  10. 1/4 test-lib-functions: introduce test_line_count_cmdĐoàn Trần Công Danh, Jun 12, 2021
  11. Eric SunshineJun 13, 2021
  12. Đoàn Trần Công DanhJun 13, 2021
  13. Ævar Arnfjörð BjarmasonJun 13, 2021
  14. Đoàn Trần Công DanhJun 13, 2021
  15. Phillip WoodJun 13, 2021
  16. Felipe ContrerasJun 13, 2021
  17. Eric SunshineJun 13, 2021
  18. Junio C HamanoJun 14, 2021
  19. Ævar Arnfjörð BjarmasonJun 24, 2021
  20. Ævar Arnfjörð BjarmasonJun 13, 2021
  21. Junio C HamanoJun 14, 2021
  22. Đoàn Trần Công DanhJun 15, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.