[PATCH 2 of 2] tests: partially stabilize test-fix-* for Windows

Matt Harbison mharbison72 at gmail.com
Fri Mar 30 21:43:42 EDT 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1522458729 14400
#      Fri Mar 30 21:12:09 2018 -0400
# Node ID 3262e4f5d83b86754e8d4bd56ba651cf166a87d8
# Parent  d0bae217b58314cd50c43e345e754f2f373b0441
tests: partially stabilize test-fix-* for Windows

It looks like {rootpath} may not be getting translated on Windows.  But this
eliminates all of the other test spew.

  --- c:/Users/Matt/projects/hg/tests/test-fix.t
  +++ c:/Users/Matt/projects/hg/tests/test-fix.t.err
  @@ -465,7 +465,7 @@
     $ hg --config "fix.fail:command=sh $TESTTMP/cmd.sh {rootpath}" \
     >    --config "fix.fail:fileset=hello.txt" \
     >    fix --working-dir
  -  [wdir] fail: hello.txt: some
  +  [wdir] fail: : some
     [wdir] fail: error
     $ cat hello.txt
     hello

diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -6,7 +6,7 @@ relationships. We indicate fixed file co
   > [extensions]
   > fix =
   > [fix]
-  > uppercase-whole-file:command=sed -e 's/.*/\U&/'
+  > uppercase-whole-file:command=sed -e "s/.*/\U&/"
   > uppercase-whole-file:fileset=set:**
   > EOF
 
diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -10,10 +10,10 @@ choose which behavior to use by naming f
   > evolution.createmarkers=True
   > evolution.allowunstable=True
   > [fix]
-  > uppercase-whole-file:command=sed -e 's/.*/\U&/'
+  > uppercase-whole-file:command=sed -e "s/.*/\U&/"
   > uppercase-whole-file:fileset=set:**.whole
   > uppercase-changed-lines:command=sed
-  > uppercase-changed-lines:linerange=-e '{first},{last} s/.*/\U&/'
+  > uppercase-changed-lines:linerange=-e "{first},{last} s/.*/\U&/"
   > uppercase-changed-lines:fileset=set:**.changed
   > EOF
 
@@ -458,8 +458,11 @@ print the filename if it is relevant.
   $ printf "hello\n" > hello.txt
   $ hg add
   adding hello.txt
-  $ hg --config "fix.fail:command=printf 'HELLO\n' ; \
-  >                               printf '{rootpath}: some\nerror' >&2" \
+  $ cat >> $TESTTMP/cmd.sh <<EOF
+  > printf 'HELLO\n'
+  > printf "$@: some\nerror" >&2
+  > EOF
+  $ hg --config "fix.fail:command=sh $TESTTMP/cmd.sh {rootpath}" \
   >    --config "fix.fail:fileset=hello.txt" \
   >    fix --working-dir
   [wdir] fail: hello.txt: some
@@ -878,7 +881,7 @@ useful for anyone trying to set up a new
   $ hg commit -Aqm "foo"
   $ printf "Foo\nbar\nBaz\n" > foo.changed
   $ hg --debug fix --working-dir
-  subprocess: sed -e '1,1 s/.*/\U&/' -e '3,3 s/.*/\U&/'
+  subprocess: sed -e "1,1 s/.*/\U&/" -e "3,3 s/.*/\U&/"
 
   $ cd ..
 


More information about the Mercurial-devel mailing list