test-split: stabilize for Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 22 Dec 2017 02:38:08 -0500
changeset 35483 8d05705bde0a
parent 35482 5a73a0446afd
child 35484 01b084914a60
test-split: stabilize for Windows - $PYTHON needs to be quoted when used as an executable in $HGEDITOR. This avoids the error "'c' is not recognized as an internal or external command". - seq.py is printing out CRLF, and then the subsequent `sed` script seems to convert to LF on MSYS. IDK if python print statements can be made to print LF on Windows, and I'm pretty sure CRLF is baked into some other tests. - A stray glob was causing the 'obsstore-off' case to report 'no result code from test'. - When I ran with --debug, the `hg diff` commands in the test both printed color sequences, and paused the output as it was run through the pager.
tests/test-split.t
--- a/tests/test-split.t	Thu Dec 21 23:31:46 2017 -0500
+++ b/tests/test-split.t	Fri Dec 22 02:38:08 2017 -0500
@@ -20,6 +20,8 @@
   > split=
   > [ui]
   > interactive=1
+  > color=no
+  > paginate=never
   > [diff]
   > git=1
   > unified=0
@@ -57,9 +59,10 @@
   abort: cannot split working directory
   [255]
 
-Generate some content
+Generate some content.  The sed filter drop CR on Windows, which is dropped in
+the a > b line.
 
-  $ $TESTDIR/seq.py 1 5 >> a
+  $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a
   $ hg ci -m a1 -A a -q
   $ hg bookmark -i r1
   $ sed 's/1/11/;s/3/33/;s/5/55/' a > b
@@ -132,7 +135,7 @@
   [255]
   $ hg status
 
-  $ HGEDITOR="$PYTHON $TESTTMP/editor.py"
+  $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
   $ runsplit
   diff --git a/a b/a
   1 hunks, 1 lines changed
@@ -197,7 +200,7 @@
   EDITOR: HG: user: test
   EDITOR: HG: branch 'default'
   EDITOR: HG: changed a
-  saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (glob) (obsstore-off !)
+  saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !)
 
 #if obsstore-off
   $ hg bookmark