# HG changeset patch # User Matt Harbison # Date 2015-11-09 18:12:35 # Node ID 4e566f513fd80d353430e88251e3460ce1af0fb1 # Parent af1ae4ee755ce80368fa998c2aacaf95f27ea136 tests: tolerate differences between Linux and Windows error strings These are related to differences in how missing files and network connection failures are displayed. I opted to combine the strings in one line instead of using '#if windows' blocks around entire commands in order to avoid future changes being accidentally missed in the Windows sections. Globbing away the entire output seemed wrong, as it could mask other failures. The raw messages involved are: Linux Windows "* not known" <-> "getaddrinfo failed" "Connection refused" <-> "No connection could be made because the target machine actively refused it" "No such file or directory" <-> "The system cannot find the file specified" Issue 4941 indicates that NetBSD has yet another string for "* not known". Also, the histedit test shows that the missing file is printed first on Windows, last on Linux. That is controlled in windows.py:posixfile if we care to change it. diff --git a/tests/test-clonebundles.t b/tests/test-clonebundles.t --- a/tests/test-clonebundles.t +++ b/tests/test-clonebundles.t @@ -84,7 +84,7 @@ Manifest file with invalid URL aborts $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest $ hg clone http://localhost:$HGPORT 404-url applying clone bundle from http://does.not.exist/bundle.hg - error fetching bundle: * not known (glob) + error fetching bundle: (.* not known|getaddrinfo failed) (re) abort: error applying bundle (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false") [255] @@ -94,7 +94,7 @@ Server is not running aborts $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest $ hg clone http://localhost:$HGPORT server-not-runner applying clone bundle from http://localhost:$HGPORT1/bundle.hg - error fetching bundle: Connection refused + error fetching bundle: * refused* (glob) abort: error applying bundle (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false") [255] diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t +++ b/tests/test-histedit-arguments.t @@ -339,7 +339,7 @@ Corrupt histedit state file $ mv ../corrupt-histedit .hg/histedit-state $ hg histedit --abort warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up - abort: No such file or directory: * (glob) + abort: .*(No such file or directory:|The system cannot find the file specified).* (re) [255] Histedit state has been exited $ hg summary -q diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -1158,7 +1158,7 @@ Wreak havoc on the unshelve process $ rm .hg/unshelverebasestate $ hg unshelve --abort unshelve of 'default' aborted - abort: No such file or directory + abort: (No such file or directory|The system cannot find the file specified) (re) [255] Can the user leave the current state? $ hg up -C .