Patchwork [1,of,3] tests: stabilize the sorted output of list-tree.py on Windows

login
register
mail settings
Submitter Matt Harbison
Date Dec. 10, 2017, 8:47 p.m.
Message ID <d607e334441c01020660.1512938863@Envy>
Download mbox | patch
Permalink /patch/26202/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 10, 2017, 8:47 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1512881204 18000
#      Sat Dec 09 23:46:44 2017 -0500
# Node ID d607e334441c01020660497186aa11945bba670e
# Parent  c7d49b87c1ee06b14d72de0ff58018bb10b49220
tests: stabilize the sorted output of list-tree.py on Windows

The test-largefiles-misc.t test was moving 'dir2\' before 'dir\' because while
'/' precedes most of the printable ASCII characters, '\' comes after numbers and
capital letters, among other symbols.

Patch

diff --git a/tests/list-tree.py b/tests/list-tree.py
--- a/tests/list-tree.py
+++ b/tests/list-tree.py
@@ -24,4 +24,4 @@ 
         else:
             yield p
 
-print('\n'.join(sorted(gather())))
+print('\n'.join(sorted(gather(), key=lambda x: x.replace(os.path.sep, '/'))))