Path: Add CreateFileURL()

This commit is contained in:
Stenzek
2024-03-13 19:51:44 +10:00
committed by Connor McLaughlin
parent b4992856f7
commit 515cbc7b29
7 changed files with 133 additions and 70 deletions

View File

@@ -228,6 +228,16 @@ TEST(Path, ChangeFileName)
#endif
}
TEST(Path, CreateFileURL)
{
#ifdef _WIN32
ASSERT_EQ(Path::CreateFileURL("C:\\foo\\bar"), "file:///C:/foo/bar");
ASSERT_EQ(Path::CreateFileURL("\\\\server\\share\\file.txt"), "file://server/share/file.txt");
#else
ASSERT_EQ(Path::CreateFileURL("/foo/bar"), "file:///foo/bar");
#endif
}
#if 0
// Relies on presence of files.