changeset 46867:915a60bf3cb6

tests: handle Windows file separator differences in test-config.t Differential Revision: https://phab.mercurial-scm.org/D10299
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 03 Apr 2021 20:25:37 -0400
parents 7ce8b4d2bd55
children 802ba3c81507
files tests/test-config.t
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-config.t	Sat Apr 03 15:02:09 2021 -0400
+++ b/tests/test-config.t	Sat Apr 03 20:25:37 2021 -0400
@@ -1,3 +1,17 @@
+Windows needs ';' as a file separator in an environment variable, and MSYS
+doesn't automatically convert it in every case.
+
+#if windows
+  $ path_list_var() {
+  >     echo $1 | sed 's/:/;/'
+  > }
+#else
+  $ path_list_var() {
+  >     echo $1
+  > }
+#endif
+
+
 hide outer repo
   $ hg init
 
@@ -446,7 +460,7 @@
 
 If file B is read after file A, value from B overwrite value from A.
 
-  $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic
+  $ HGRCPATH=`path_list_var "file-A.rc:file-B.rc"` hg config config-test.basic
   value-B
 
 Ordering from include
@@ -462,7 +476,7 @@
 command line override
 ---------------------
 
-  $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic --config config-test.basic=value-CLI
+  $ HGRCPATH=`path_list_var "file-A.rc:file-B.rc"` hg config config-test.basic --config config-test.basic=value-CLI
   value-CLI
 
 Alias ordering
@@ -480,7 +494,7 @@
   value-A
   $ HGRCPATH="file-B.rc" hg log -r .
   value-B
-  $ HGRCPATH="file-A.rc:file-B.rc" hg log -r .
+  $ HGRCPATH=`path_list_var "file-A.rc:file-B.rc"` hg log -r .
   value-B
 
 Alias and include
@@ -497,5 +511,5 @@
 command line override
 ---------------------
 
-  $ HGRCPATH="file-A.rc:file-B.rc" hg log -r . --config ui.logtemplate="value-CLI\n"
+  $ HGRCPATH=`path_list_var "file-A.rc:file-B.rc"` hg log -r . --config ui.logtemplate="value-CLI\n"
   value-CLI