Mercurial > hg-stable
changeset 28336:a5a13eeffc59
tests: Solaris sed does not support "\n" meaning newline in the RHS of s///
The blackbox test rewrites a copy of test-dispatch.py on the fly, and adds
a couple of lines with the s/// command. GNU sed supports the use of the
\n escape to represent a newline, but not Solaris sed. Using a literal
newline, prefixed by a backslash, works with both versions of the utility.
author | Danek Duvall <danek.duvall@oracle.com> |
---|---|
date | Wed, 02 Mar 2016 14:55:13 -0800 |
parents | 515018f64c41 |
children | 869e65e68aee |
files | tests/test-blackbox.t |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-blackbox.t Wed Mar 02 14:50:37 2016 -0800 +++ b/tests/test-blackbox.t Wed Mar 02 14:55:13 2016 -0800 @@ -154,7 +154,9 @@ 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox $ mv .hg/blackbox.log .hg/blackbox.log- $ mkdir .hg/blackbox.log - $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\nos.rename(".hg/blackbox.log-", ".hg/blackbox.log")\n\1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py + $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\ + > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\ + > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py $ python ../test-dispatch.py running: add foo result: 0