Mercurial > hg
diff tests/test-help.t @ 50725:7e5be4a7cda7 stable
tests: use grep -E instead of obsolescent egrep
Testing on Fedora 38 failed with:
egrep: warning: egrep is obsolescent; using grep -E
The warning comes from
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1
. For further anecdotal evidence of the change, see
https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep .
This reverses the code check that goes back to e7d3b509af8b. grep -E is POSIX,
but there is a risk that it doesn't work the same on all platforms - especially
older Unix versions. It should however always be possible to put a GNU grep in
$PATH before running the tests.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Mon, 26 Jun 2023 14:34:58 +0200 |
parents | 8fb3e942473a |
children | 752c5a5b73c6 |
line wrap: on
line diff
--- a/tests/test-help.t Mon Jun 26 11:15:30 2023 +0100 +++ b/tests/test-help.t Mon Jun 26 14:34:58 2023 +0200 @@ -799,7 +799,7 @@ Checking that help adapts based on the config: - $ hg help diff --config ui.tweakdefaults=true | egrep -e '^ *(-g|config)' + $ hg help diff --config ui.tweakdefaults=true | grep -E -e '^ *(-g|config)' -g --[no-]git use git extended diff format (default: on from config) @@ -1585,7 +1585,7 @@ Show nested definitions ("profiling.type"[break]"ls"[break]"stat"[break]) - $ hg help config.type | egrep '^$'|wc -l + $ hg help config.type | grep -E '^$'|wc -l \s*3 (re) $ hg help config.profiling.type.ls @@ -1598,7 +1598,7 @@ Separate sections from subsections - $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq + $ hg help config.format | grep -E '^ ("|-)|^\s*$' | uniq "format" -------- @@ -1660,7 +1660,7 @@ Test templating help - $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) ' + $ hg help templating | grep -E '(desc|diffstat|firstline|nonempty) ' desc String. The text of the changeset description. diffstat String. Statistics of changes with the following format: firstline Any text. Returns the first line of text. @@ -1701,12 +1701,12 @@ help -c should only show debug --debug - $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$' + $ hg help -c --debug|grep -E debug|wc -l|grep -E '^\s*0\s*$' [1] help -c should only show deprecated for -v - $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$' + $ hg help -c -v|grep -E DEPRECATED|wc -l|grep -E '^\s*0\s*$' [1] Test -s / --system @@ -1720,11 +1720,11 @@ Test -e / -c / -k combinations - $ hg help -c|egrep '^[A-Z].*:|^ debug' + $ hg help -c|grep -E '^[A-Z].*:|^ debug' Commands: - $ hg help -e|egrep '^[A-Z].*:|^ debug' + $ hg help -e|grep -E '^[A-Z].*:|^ debug' Extensions: - $ hg help -k|egrep '^[A-Z].*:|^ debug' + $ hg help -k|grep -E '^[A-Z].*:|^ debug' Topics: Commands: Extensions: @@ -1735,11 +1735,11 @@ [10] $ hg help -e schemes |head -1 schemes extension - extend schemes with shortcuts to repository swarms - $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):' + $ hg help -c -k dates |grep -E '^(Topics|Extensions|Commands):' Commands: - $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):' + $ hg help -e -k a |grep -E '^(Topics|Extensions|Commands):' Extensions: - $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):' + $ hg help -e -c -k date |grep -E '^(Topics|Extensions|Commands):' Extensions: Commands: $ hg help -c commit > /dev/null