@@ -124,7 +124,7 @@ def test_fix_path(path, expected):
124
124
# absolute
125
125
("/" , posixpath , "/" ),
126
126
("/spam.py" , posixpath , "/spam.py" ),
127
- ("\\ " , ntpath , ".\\ " if is_python313_or_later () else "\\ " ),
127
+ ("\\ " , ntpath , ".\\ \\ " if is_python313_or_later () else "\\ " ),
128
128
(r"\spam.py" , ntpath , r".\\spam.py" if is_python313_or_later () else r"\spam.py" ),
129
129
(r"C:\spam.py" , ntpath , r"C:\spam.py" ),
130
130
# no-op
@@ -225,11 +225,11 @@ def test_fix_fileid(fileid, os_path, expected):
225
225
("/eggs/spam.py" , "/eggs" , ntpath , "./spam.py" ),
226
226
("/eggs/spam.py" , "/eggs/" , ntpath , "./spam.py" ),
227
227
# no-op
228
- ("/spam.py" , "/eggs" , ntpath , "/spam.py" ),
229
- ("/spam.py" , "/eggs/" , ntpath , "/spam.py" ),
228
+ ("/spam.py" , "/eggs" , ntpath , ".//spam.py" if is_python313_or_later () else " /spam.py" ),
229
+ ("/spam.py" , "/eggs/" , ntpath , ".//spam.py" if is_python313_or_later () else " /spam.py" ),
230
230
# root-only (no-op)
231
231
("/" , "/" , ntpath , "/" ),
232
- ("/" , "/spam" , ntpath , "/" ),
232
+ ("/" , "/spam" , ntpath , ".//" if is_python313_or_later () else " /" ),
233
233
("//" , "/" , ntpath , "//" ),
234
234
("//" , "//" , ntpath , "//" ),
235
235
("//" , "//spam" , ntpath , "//" ),
@@ -244,11 +244,11 @@ def test_fix_fileid(fileid, os_path, expected):
244
244
(r"\eggs\spam.py" , "\\ Eggs" , ntpath , r"./spam.py" ),
245
245
(r"\eggs\Spam.py" , "\\ Eggs" , ntpath , r"./Spam.py" ),
246
246
# no-op
247
- (r"\spam.py" , r"\eggs" , ntpath , r"/spam.py" ),
247
+ (r"\spam.py" , r"\eggs" , ntpath , ".//spam.py" if is_python313_or_later () else r"/spam.py" ),
248
248
(r"C:\spam.py" , r"C:\eggs" , ntpath , r"C:/spam.py" ),
249
249
# TODO: Should these be supported.
250
250
(r"C:\spam.py" , "\\ " , ntpath , r"C:/spam.py" ),
251
- (r"\spam.py" , "C:\\ " , ntpath , r"/spam.py" ),
251
+ (r"\spam.py" , "C:\\ " , ntpath , ".//spam.py" if is_python313_or_later () else r"/spam.py" ),
252
252
# root-only
253
253
("\\ " , "\\ " , ntpath , "/" ),
254
254
("\\ \\ " , "\\ " , ntpath , "//" ),
0 commit comments