[PATCH] tests: add test-help-verbose.t

Yuya Nishihara yuya at tcha.org
Sat Apr 9 06:53:01 EDT 2016


On Wed, 06 Apr 2016 23:36:39 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1453445322 0
> #      Fri Jan 22 06:48:42 2016 +0000
> # Node ID a35384e303fe4e09730377b216dae353f95a10e3
> # Parent  ea86cdcd9b50bf38c6b9dd7bbaa04b9c8cc0aefb
> tests: add test-help-verbose.t
> 
> Check help for each command

Can you provide more detailed commit message and comments? It's hard to guess
what kind of errors this test is intended to catch, and how.

> --- /dev/null
> +++ b/tests/test-help-verbose.t
> @@ -0,0 +1,28 @@
> +#require slow
> +
> +look for outliers in command help
> +collect all extensions
> +
> +  $ HGE=`hg help extensions | \
> +  > sed -n 's/^     \([a-z][^ ]*\).*/ --config extensions.\1=/p'`
> +
> +collect all commands
> +
> +  $ HGC=`hg $HGE debugcomplete 2>/dev/null`
> +
> +  $ FIRST='first line description of commands should not be Sentence cased'
> +  $ FLAGS='help for flags should not be Sentence cased'
> +  $ BADHG='improper :hg: escape'
> +  $ PUNCT='paragraph should end with punctuation'
> +
> +  $ for c in $HGC;
> +  > do hg $HGE help -c $c 2>/dev/null > help;
> +  > cat help | head -3 | tail -1 | egrep '/^[A-Z]/;' && echo $c: $FIRST
> +  > cat help | egrep '^ -'| egrep '[ +]. [A-Z]' && echo $c: $FLAGS
> +  > cat help | grep ":hg'" && echo $c: $BADHG
> +  > cat help | head `grep -n '^options' help |sed -e 's/:.*//;s/^/-n /'` | \
> +  >   egrep '^ |^$' | \
> +  >   awk -v RS="\n\n" \
> +  >     '/^    [a-zA-Z].*[a-zA-Z]\s*$/ { print }' | \
> +  >   egrep '.' && echo $c: $PUNCT

This is the first user of awk. Perhaps we would try to not depend on awk.


More information about the Mercurial-devel mailing list