@@ -124,7 +124,7 @@ def test_fix_path(path, expected):
124124 # absolute
125125 ("/" , posixpath , "/" ),
126126 ("/spam.py" , posixpath , "/spam.py" ),
127- ("\\ " , ntpath , ".\\ " if is_python313_or_later () else "\\ " ),
127+ ("\\ " , ntpath , ".\\ \\ " if is_python313_or_later () else "\\ " ),
128128 (r"\spam.py" , ntpath , r".\\spam.py" if is_python313_or_later () else r"\spam.py" ),
129129 (r"C:\spam.py" , ntpath , r"C:\spam.py" ),
130130 # no-op
@@ -225,11 +225,11 @@ def test_fix_fileid(fileid, os_path, expected):
225225 ("/eggs/spam.py" , "/eggs" , ntpath , "./spam.py" ),
226226 ("/eggs/spam.py" , "/eggs/" , ntpath , "./spam.py" ),
227227 # 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" ),
230230 # root-only (no-op)
231231 ("/" , "/" , ntpath , "/" ),
232- ("/" , "/spam" , ntpath , "/" ),
232+ ("/" , "/spam" , ntpath , ".//" if is_python313_or_later () else " /" ),
233233 ("//" , "/" , ntpath , "//" ),
234234 ("//" , "//" , ntpath , "//" ),
235235 ("//" , "//spam" , ntpath , "//" ),
@@ -244,11 +244,11 @@ def test_fix_fileid(fileid, os_path, expected):
244244 (r"\eggs\spam.py" , "\\ Eggs" , ntpath , r"./spam.py" ),
245245 (r"\eggs\Spam.py" , "\\ Eggs" , ntpath , r"./Spam.py" ),
246246 # 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" ),
248248 (r"C:\spam.py" , r"C:\eggs" , ntpath , r"C:/spam.py" ),
249249 # TODO: Should these be supported.
250250 (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" ),
252252 # root-only
253253 ("\\ " , "\\ " , ntpath , "/" ),
254254 ("\\ \\ " , "\\ " , ntpath , "//" ),
0 commit comments