7
7
from testsuite .support import ROOT_DIR , PseudoFile
8
8
9
9
10
+ def safe_line_split (line ):
11
+ split = line .split (':' )
12
+ if 'win' in sys .platform :
13
+ try :
14
+ drive , path , x , y , msg = split
15
+ path = drive + ':' + path
16
+ except :
17
+ path , x , y , msg = split
18
+ else :
19
+ path , x , y , msg = split
20
+ return path , x , y , msg
21
+
22
+
10
23
class ShellTestCase (unittest .TestCase ):
11
24
"""Test the usual CLI options and output."""
12
25
@@ -77,7 +90,7 @@ def test_check_simple(self):
77
90
self .assertFalse (stderr )
78
91
self .assertEqual (len (stdout ), 17 )
79
92
for line , num , col in zip (stdout , (3 , 6 , 9 , 12 ), (3 , 6 , 1 , 5 )):
80
- path , x , y , msg = line . split ( ':' )
93
+ path , x , y , msg = safe_line_split ( line )
81
94
self .assertTrue (path .endswith (E11 ))
82
95
self .assertEqual (x , str (num ))
83
96
self .assertEqual (y , str (col ))
@@ -141,7 +154,7 @@ def test_check_diff(self):
141
154
self .assertEqual (errcode , 1 )
142
155
self .assertFalse (stderr )
143
156
for line , num , col in zip (stdout , (3 , 6 ), (3 , 6 )):
144
- path , x , y , msg = line . split ( ':' )
157
+ path , x , y , msg = safe_line_split ( line )
145
158
self .assertEqual (x , str (num ))
146
159
self .assertEqual (y , str (col ))
147
160
self .assertTrue (msg .startswith (' E11' ))
@@ -154,7 +167,7 @@ def test_check_diff(self):
154
167
self .assertEqual (errcode , 1 )
155
168
self .assertFalse (stderr )
156
169
for line , num , col in zip (stdout , (3 , 6 ), (3 , 6 )):
157
- path , x , y , msg = line . split ( ':' )
170
+ path , x , y , msg = safe_line_split ( line )
158
171
self .assertEqual (x , str (num ))
159
172
self .assertEqual (y , str (col ))
160
173
self .assertTrue (msg .startswith (' E11' ))
0 commit comments