@@ -165,6 +165,26 @@ def test_relpath(path: str, start: str, alt_separator: str, result: str) -> None
165165 assert fsutil .relpath (path , start , alt_separator = alt_separator ) == result
166166
167167
168+ @pytest .mark .parametrize (
169+ ("paths, alt_separator, result" ),
170+ [
171+ (["/some/dir/some/file" , "/some/dir/some/other" ], "" , "/some/dir/some" ),
172+ (["/some/dir/some/file" , "/some/dir/some/other" ], "\\ " , "/some/dir/some" ),
173+ (["\\ some\\ dir\\ some\\ file" , "\\ some\\ dir\\ some\\ other" ], "\\ " , "/some/dir/some" ),
174+ (["/some/dir/some/file" , "/some/dir/other" ], "" , "/some/dir" ),
175+ (["/some/dir/some/file" , "/some/other" ], "" , "/some" ),
176+ (["/some/dir/some/file" , "/some/other" ], "\\ " , "/some" ),
177+ ],
178+ )
179+ def test_commonpath (paths : list [str ], alt_separator : str , result : str ) -> None :
180+ assert fsutil .commonpath (paths , alt_separator = alt_separator ) == result
181+
182+
183+ def test_isreserved () -> None :
184+ assert not fsutil .isreserved ("CON" )
185+ assert not fsutil .isreserved ("foo" )
186+
187+
168188def test_generate_addr () -> None :
169189 slash_path = "/some/dir/some/file"
170190 slash_vfs = VirtualFilesystem (alt_separator = "" )
@@ -312,9 +332,10 @@ def test_target_path_is_relative_to(path_fs: VirtualFilesystem) -> None:
312332
313333
314334def test_target_path_is_reserved (path_fs : VirtualFilesystem ) -> None :
315- # We currently do not have any reserved names for TargetPath
316- assert not path_fs .path ("CON" ).is_reserved ()
317- assert not path_fs .path ("foo" ).is_reserved ()
335+ if sys .version_info < (3 , 13 ):
336+ # We currently do not have any reserved names for TargetPath
337+ assert not path_fs .path ("CON" ).is_reserved ()
338+ assert not path_fs .path ("foo" ).is_reserved ()
318339
319340
320341def test_target_path_join (path_fs : VirtualFilesystem ) -> None :
0 commit comments