tests: fix for POSIX compliance
authorMartijn Pieters <mj@octobus.net>
Wed, 21 Nov 2018 11:13:21 +0000
changeset 4267 18ed2a237ab5
parent 4266 a4a35fb44af3
child 4268 d5a2cc19903f
tests: fix for POSIX compliance * Mac ls will exit with a different message and exit code [1], replace with grep (which is what mercurial tests do) * POSIX echo has no -n switch, use printf instead
tests/test-discovery-obshashrange-cache.t
tests/test-evolve-stop-orphan.t
--- a/tests/test-discovery-obshashrange-cache.t	Wed Nov 21 10:47:07 2018 +0000
+++ b/tests/test-discovery-obshashrange-cache.t	Wed Nov 21 11:13:21 2018 +0000
@@ -28,7 +28,7 @@
   $ hg -R main debugbuilddag '.+7'
 
   $ for node in `hg -R main log -T '{node}\n'`; do
-  >     echo -n $node | grep -o . | sort |tr -d "\n" > ancfile
+  >     printf $node | grep -o . | sort |tr -d "\n" > ancfile
   >     anc=`cat ancfile`
   >     rm ancfile
   >     echo "marking $anc as predecessors of $node"
--- a/tests/test-evolve-stop-orphan.t	Wed Nov 21 10:47:07 2018 +0000
+++ b/tests/test-evolve-stop-orphan.t	Wed Nov 21 11:13:21 2018 +0000
@@ -109,9 +109,8 @@
 Checking working dir
   $ hg status
 Checking for incomplete mergestate
-  $ ls .hg/merge
-  ls: cannot access .?\.hg/merge.?: No such file or directory (re)
-  [2]
+  $ ls .hg/ | grep merge
+  [1]
 
 Checking graph
   $ hg glog