diff tests/test-dispatch.t @ 35230:feecfefeba25

tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages Automatic replacement seems better than trying to figure out a check-code rule. I didn't bother looking to see why the error message and file name is reversed in the annotate and histedit tests, based on Windows or not. I originally had this as a list of tuples, conditional on the platform. But there are a couple of 'No such file or directory' messages emitted by Mercurial itself, so unconditional is required for stability. There are also several variants of what I assume is 'connection refused' and 'unknown host' in test-clone.t and test-clonebundles.t for Docker, FreeBSD jails, etc. Yes, these are handled by (re) tags, but maybe it would be better to capture those strings in order to avoid whack-a-mole in future tests. All of this points to using a dictionary containing one or more strings-to-be-replaced values.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 02 Dec 2017 19:33:34 -0500
parents 98a5aa5575e7
children 4441705b7111
line wrap: on
line diff
--- a/tests/test-dispatch.t	Sun Dec 03 20:55:35 2017 -0800
+++ b/tests/test-dispatch.t	Sat Dec 02 19:33:34 2017 -0500
@@ -94,8 +94,7 @@
   [255]
 
   $ hg log -b --cwd=inexistent default
-  abort: No such file or directory: 'inexistent' (no-windows !)
-  abort: The system cannot find the file specified: 'inexistent' (windows !)
+  abort: $ENOENT$: 'inexistent'
   [255]
 
   $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
@@ -212,7 +211,7 @@
 The output could be one of the following and something else:
  chg: abort: failed to getcwd (errno = *) (glob)
  abort: error getting current working directory: * (glob)
- sh: 0: getcwd() failed: No such file or directory
+ sh: 0: getcwd() failed: $ENOENT$
 Since the exact behavior depends on the shell, only check it returns non-zero.
   $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
   [1]