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

Re: [PATCH] t3000 (ls-files -o): modernize style

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 11, 2010, 08:33 UTC
Message-ID
<m3d3uul8pd.fsf@localhost.localdomain>
In-Reply-To
<20100711042025.GA7424@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 8 quoted lines
> This script is part of the second batch of tests, from the same day
> the test infrastructure was added to git.  Update it to use a more
> modern style in the spirit of v1.6.4-rc0~45^2~2 (2009-05-22).
> In particular:
> 
>  - Put setup code inside test assertions, to avoid unexpected
>    breakages and avoid stray output without -v (as t/README
>    recommends); and
O.K., but...
 
Show 30 quoted lines
> -cat >expected1 <<EOF
> -expected1
> -expected2
> -expected3
> -output
> -path0
> -path1
> -path2-junk
> -path2/file2
> -EOF
> -sed -e 's|path2/file2|path2/|' <expected1 >expected2
> -cat <expected2 >expected3
> -echo path4/ >>expected2
> -
> +test_expect_success 'setup: expected output' '
> +	cat >expected1 <<-\EOF &&
> +	expected1
> +	expected2
> +	expected3
> +	output
> +	path0
> +	path1
> +	path2-junk
> +	path2/file2
> +	EOF
> +
> +	sed -e "s|path2/file2|path2/|" <expected1 >expected2 &&
> +	cp expected2 expected3 &&
> +	echo path4/ >>expected2
> +'

... I don't think it is really needed. There isn't anything there that can fail, and there isn't anything there that produces any output.

BTW. do all sane shells that can be used to run test suite support '<<-' here-doc redirection operators? Is it in POSIX?

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Jonathan NiederNext: Ævar Arnfjörð Bjarmason
Message 2 of 4 in “t3000 (ls-files -o): modernize style”
  1. t3000 (ls-files -o): modernize styleJonathan Nieder, Jul 11, 2010
  2. Jakub NarebskiJul 11, 2010
  3. Ævar Arnfjörð BjarmasonJul 11, 2010
  4. Jonathan NiederJul 11, 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.