test: the in-memory disk has the root of an absolute Linux path

This commit is contained in:
maj00r
2026-11-13 17:44:26 +01:00
parent 1b41ef752a
commit 7cd3ef8f1a

View File

@@ -275,6 +275,9 @@ public sealed class InMemoryFileSystem : IFileSystem
return; return;
slash = key.LastIndexOf('/'); slash = key.LastIndexOf('/');
} }
// An absolute Unix path's parent is the root, "/", which normalises to "".
if (slash == 0)
_directories.Add("");
} }
private static string Normalize(string path) => private static string Normalize(string path) =>