Patchwork [3,of,5] tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages

login
register
mail settings
Submitter Matt Harbison
Date Dec. 3, 2017, 6:54 a.m.
Message ID <ee5f78d85b5f398ae6a1.1512284096@Envy>
Download mbox | patch
Permalink /patch/25904/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 3, 2017, 6:54 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1512265103 18000
#      Sat Dec 02 20:38:23 2017 -0500
# Node ID ee5f78d85b5f398ae6a1af6cdf7f9565b6910d40
# Parent  8e58a105a6fc156673e852ec9a40f2d517fc7ceb
tests: add a substitution for ENOTDIR/ERROR_PATH_NOT_FOUND messages

Patch

diff --git a/tests/common-pattern.py b/tests/common-pattern.py
--- a/tests/common-pattern.py
+++ b/tests/common-pattern.py
@@ -47,6 +47,13 @@ 
         # FormatMessage(ERROR_FILE_NOT_FOUND)
         br'The system cannot find the file specified',
     ),
+    br'$ENOTDIR$': (
+        # strerror()
+        br'Not a directory',
+
+        # FormatMessage(ERROR_PATH_NOT_FOUND)
+        br'The system cannot find the path specified',
+    ),
 }
 
 for replace, msgs in _errors.items():
diff --git a/tests/test-origbackup-conflict.t b/tests/test-origbackup-conflict.t
--- a/tests/test-origbackup-conflict.t
+++ b/tests/test-origbackup-conflict.t
@@ -129,8 +129,7 @@ 
   b/c: replacing untracked file
   getting b/c
   creating directory: $TESTTMP/repo/.hg/badorigbackups/b (glob)
-  abort: The system cannot find the path specified: '$TESTTMP/repo/.hg/badorigbackups/b' (glob) (windows !)
-  abort: Not a directory: '$TESTTMP/repo/.hg/badorigbackups/b' (no-windows !)
+  abort: $ENOTDIR$: '$TESTTMP/repo/.hg/badorigbackups/b' (glob)
   [255]
   $ cat .hg/badorigbackups
   data