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

Re: [PATCH 3/4] tests: use test_cmp instead of piping to diff(1)

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 14, 2010, 17:41 UTC
Message-ID
<20101114174133.GD26459@burratino>
In-Reply-To
<1289745857-16704-4-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> --- a/t/t4041-diff-submodule-option.sh
> +++ b/t/t4041-diff-submodule-option.sh
> @@ -37,9 +37,10 @@ head1=$(add_file sm1 foo1 foo2)
>  test_expect_success 'added submodule' "
>  	git add sm1 &&
>  	git diff-index -p --submodule=log HEAD >actual &&
> -	diff actual - <<-EOF
> +	cat >expected <<-EOF &&
>  Submodule sm1 0000000...$head1 (new submodule)
>  EOF
> +	test_cmp expected actual
>  "

Nice. Reminds me of http://thread.gmane.org/gmane.comp.version-control.git/160168/focus=160222 (use of "cmp - foo.expect" in git svn tests); anyone want to take a stab at fixing that, too?

> --- a/t/t7401-submodule-summary.sh
> +++ b/t/t7401-submodule-summary.sh
[...]
>  test_expect_success '--for-status' "
>      git submodule summary --for-status HEAD^ >actual &&
> -    test_cmp actual - <<EOF
> +	test_cmp actual - <<EOF
I think this tab should be spaces?  Also, shouldn't this be
	cat >expect <<EOF &&
	...
	EOF
	test_cmp expect actual
to match the others?  There are a few similar cases in the patch.
I assume you've checked the patched tests still pass.  So with the exception
just mentioned,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 16 of 25 in “[PULL] ab/i18n-prereqs, prerequisites for ab/i18n”
  1. 0/4 [PULL] ab/i18n-prereqs, prerequisites for ab/i18nÆvar Arnfjörð Bjarmason, Nov 14, 2010
  2. 1/4 Makefile: move "Platform specific tweaks" above LIB_{H,OBJS}Ævar Arnfjörð Bjarmason, Nov 14, 2010
  3. Jonathan NiederNov 14, 2010
  4. Ævar Arnfjörð BjarmasonNov 14, 2010
  5. Jonathan NiederNov 14, 2010
  6. Junio C HamanoNov 15, 2010
  7. Jonathan NiederNov 15, 2010
  8. Ævar Arnfjörð BjarmasonNov 15, 2010
  9. Junio C HamanoNov 14, 2010
  10. Jonathan NiederNov 14, 2010
  11. Junio C HamanoNov 14, 2010
  12. 2/4 t7004-tag.sh: re-arrange git tag comment for clarityÆvar Arnfjörð Bjarmason, Nov 14, 2010
  13. Jonathan NiederNov 14, 2010
  14. Ævar Arnfjörð BjarmasonNov 14, 2010
  15. 3/4 tests: use test_cmp instead of piping to diff(1)Ævar Arnfjörð Bjarmason, Nov 14, 2010
  16. Jonathan NiederNov 14, 2010
  17. 4/4 builtin: use builtin.h for all builtin commandsÆvar Arnfjörð Bjarmason, Nov 14, 2010
  18. Sverre RabbelierNov 14, 2010
  19. Ævar Arnfjörð BjarmasonNov 14, 2010
  20. Junio C HamanoNov 14, 2010
  21. Jonathan NiederNov 14, 2010
  22. Junio C HamanoNov 17, 2010
  23. Ævar Arnfjörð BjarmasonNov 17, 2010
  24. Jonathan NiederNov 17, 2010
  25. Jonathan NiederNov 14, 2010

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.