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

Re: [PATCH] test-lint-duplicates: Only check for numbered test cases

From
Jeff King <peff@peff.net>
Date
Apr 10, 2013, 16:00 UTC
Message-ID
<20130410160037.GB10749@sigill.intra.peff.net>
In-Reply-To
<516573CA.2000804@web.de>
On Wed, Apr 10, 2013 at 04:14:34PM +0200, Torsten Bögershausen wrote:
Show 13 quoted lines
> >  test-lint-duplicates:
> > -	@dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
> > +	@dups=`echo $(T) | tr ' ' '\n' | \
> > +		sed -e 's,.*/,,' -e 's/\(t[0-9][0-9][0-9][0-9]\)-.*/\1/' | \
> > +		sort | uniq -d` && \
> >  		test -z "$$dups" || { \
> >  		echo >&2 "duplicate test numbers:" $$dups; exit 1; }
> >  
> > 
> > -Peff
> I thinkg we need both the striping of the path and the "grepping" for
> numbered test cases only.
> I'll send a patch in a minute
I think it is fine either way. My command above turns:
  /path/to/test-one.sh
  /path/to/test-two.sh
into
  test-one.sh
  test-two.sh

which is fine for running through uniq. If you use "sed -n", you simply end up with an empty list, which is also fine.

-Peff
Previous: Torsten Bögershausen
Message 4 of 4 in “test-lint-duplicates: Only check for numbered test cases”
  1. test-lint-duplicates: Only check for numbered test casesTorsten Bögershausen, Apr 3, 2013
  2. Jeff KingApr 3, 2013
  3. Torsten BögershausenApr 10, 2013
  4. Jeff KingApr 10, 2013

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.