Sync filesystem.h/path.h

This commit is contained in:
Connor McLaughlin
2022-07-08 21:57:06 +10:00
parent f89529015c
commit d2ca454576
50 changed files with 1395 additions and 1861 deletions

View File

@ -1,25 +1,3 @@
#include "common/file_system.h"
#include <gtest/gtest.h>
TEST(FileSystem, IsAbsolutePath)
{
#ifdef _WIN32
ASSERT_TRUE(FileSystem::IsAbsolutePath("C:\\"));
ASSERT_TRUE(FileSystem::IsAbsolutePath("C:\\Path"));
ASSERT_TRUE(FileSystem::IsAbsolutePath("C:\\Path\\Subdirectory"));
ASSERT_TRUE(FileSystem::IsAbsolutePath("C:/"));
ASSERT_TRUE(FileSystem::IsAbsolutePath("C:/Path"));
ASSERT_TRUE(FileSystem::IsAbsolutePath("C:/Path/Subdirectory"));
ASSERT_FALSE(FileSystem::IsAbsolutePath(""));
ASSERT_FALSE(FileSystem::IsAbsolutePath("C:"));
ASSERT_FALSE(FileSystem::IsAbsolutePath("Path"));
ASSERT_FALSE(FileSystem::IsAbsolutePath("Path/Subdirectory"));
#else
ASSERT_TRUE(FileSystem::IsAbsolutePath("/"));
ASSERT_TRUE(FileSystem::IsAbsolutePath("/path"));
ASSERT_TRUE(FileSystem::IsAbsolutePath("/path/subdirectory"));
ASSERT_FALSE(FileSystem::IsAbsolutePath(""));
ASSERT_FALSE(FileSystem::IsAbsolutePath("path"));
ASSERT_FALSE(FileSystem::IsAbsolutePath("path/subdirectory"));
#endif
}