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

Re: [PATCH] Convert "! git" to "test_must_fail" git.

From
BCBrandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Date
Jul 20, 2010, 19:42 UTC
Message-ID
<_BUqzkdWhTIktk0rYFvr9jdvISwfrShKmEsXaqgCBwm0X5Urcv2osQ@cipher.nrlssc.navy.mil>
In-Reply-To
<fe4308a0ab1c3d7296efa986d5cfe63c6ff4014a.1279652856.git.jaredhance@gmail.com>

Are you sure these are working properly? If I recall correctly, test_must_fail does not act the same as '!' when a '|' is involved. I believe the '!' negates the result of the entire statement, but test_must_fail only operates on the arguments preceding the '|'.

The rest looks good, and I'm surprised there were so many.
On 07/20/2010 02:09 PM, Jared Hance wrote:
> diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
> index 8a63227..b20edff 100755
> --- a/t/t7810-grep.sh
> +++ b/t/t7810-grep.sh
Show 22 quoted lines
> @@ -134,7 +134,7 @@ do
>  	'
>  
>  	test_expect_success "grep -c $L (no /dev/null)" '
> -		! git grep -c test $H | grep /dev/null
> +		test_must_fail git grep -c test $H | grep /dev/null
>          '
>  
>  	test_expect_success "grep --max-depth -1 $L" '
> diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
> index 13766ab..9e86e9f 100755
> --- a/t/t9100-git-svn-basic.sh
> +++ b/t/t9100-git-svn-basic.sh
> @@ -245,7 +245,7 @@ test_expect_success 'dcommit $rev does not clobber current branch' '
>  	test $old_head = $(git rev-parse HEAD) &&
>  	test refs/heads/my-bar = $(git symbolic-ref HEAD) &&
>  	git log refs/remotes/bar | grep "change 1" &&
> -	! git log refs/remotes/bar | grep "change 2" &&
> +	test_must_fail git log refs/remotes/bar | grep "change 2" &&
>  	git checkout master &&
>  	git branch -D my-bar
>  	'
Previous: Jared HanceNext: Jonathan Nieder
Message 10 of 40 in “t/t3700: convert two uses of negation operator '!' to use test_must_fail”
  1. t/t3700: convert two uses of negation operator '!' to use test_must_failBrandon Casey, Jul 20, 2010
  2. Ævar Arnfjörð BjarmasonJul 20, 2010
  3. Brandon CaseyJul 20, 2010
  4. Jared HanceJul 20, 2010
  5. t/README: clarify test_must_fail descriptionBrandon Casey, Jul 20, 2010
  6. Junio C HamanoJul 20, 2010
  7. Ævar Arnfjörð BjarmasonJul 20, 2010
  8. Jared HanceJul 20, 2010
  9. Convert "! git" to "test_must_fail" git.Jared Hance, Jul 20, 2010
  10. Brandon CaseyJul 20, 2010
  11. Jonathan NiederJul 20, 2010
  12. Brandon CaseyJul 20, 2010
  13. Convert "! git" to "test_must_fail git"Jared Hance, Jul 20, 2010
  14. Junio C HamanoJul 20, 2010
  15. Ævar Arnfjörð BjarmasonJul 20, 2010
  16. Jonathan NiederJul 20, 2010
  17. Ævar Arnfjörð BjarmasonJul 20, 2010
  18. Brandon CaseyJul 20, 2010
  19. Ævar Arnfjörð BjarmasonJul 20, 2010
  20. t/: work around one-shot variable assignment with test_must_failBrandon Casey, Jul 20, 2010
  21. Erick MattosJul 20, 2010
  22. Brandon CaseyJul 21, 2010
  23. Erick MattosJul 22, 2010
  24. Ævar Arnfjörð BjarmasonJul 20, 2010
  25. Ævar Arnfjörð BjarmasonJul 20, 2010
  26. Jonathan NiederJul 21, 2010
  27. Ævar Arnfjörð BjarmasonJul 21, 2010
  28. Jonathan NiederJul 21, 2010
  29. Ævar Arnfjörð BjarmasonJul 21, 2010
  30. git name-rev for fun and profit (Re: [PATCH] t/: work around one-shot variable assignment with test_must_fail)Jonathan Nieder, Jul 21, 2010
  31. Ævar Arnfjörð BjarmasonJul 21, 2010
  32. Junio C HamanoJul 21, 2010
  33. Erick MattosJul 22, 2010
  34. Brandon CaseyJul 22, 2010
  35. Brandon CaseyJul 20, 2010
  36. Ævar Arnfjörð BjarmasonJul 20, 2010
  37. Ævar Arnfjörð BjarmasonJul 20, 2010
  38. gitweb: clarify search results page when no matching commit foundJonathan Nieder, Jul 21, 2010
  39. Jakub NarebskiJul 21, 2010
  40. gitweb: clarify search results page when no matching commit foundJonathan Nieder, Jul 21, 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.