Added scanner. (#410)

This commit is contained in:
Branimir Karadžić
2026-07-25 12:23:58 -07:00
committed by GitHub
parent cd6720ce9a
commit 9916e720fc
21 changed files with 2157 additions and 1899 deletions

View File

@@ -64,6 +64,15 @@ FilePathTest s_filePathTest[] =
{"abc\\/../..\\/././../def", "../../def"},
{"\\abc/def\\../..\\..", "/"},
// Drive letter
{"c:", "C:"},
{"c:/", "C:/"},
{"c:abc", "C:/abc"},
{"c:/abc/../def", "C:/def"},
{"c:/..", "C:/"},
{"c:/../..", "C:/"},
{"c:\\abc\\..\\def", "C:/def"},
};
struct FilePathSplit
@@ -118,6 +127,25 @@ TEST_CASE("FilePath", "[filepath][string]")
};
}
TEST_CASE("FilePath sub-view", "[filepath]")
{
const char buffer[] = "C:/abc";
bx::FilePath fp;
fp.set(bx::StringView(buffer, 2) );
REQUIRE(0 == bx::strCmp("C:", fp) );
const char buffer2[] = "ab/cd";
fp.set(bx::StringView(buffer2, 2) );
REQUIRE(0 == bx::strCmp("ab", fp) );
fp.set(bx::StringView(buffer2, 3) );
REQUIRE(0 == bx::strCmp("ab/", fp) );
fp.set(bx::StringView(buffer2, 0) );
REQUIRE(0 == bx::strCmp(".", fp) );
}
TEST_CASE("FilePath temp", "[filepath]")
{
bx::FilePath tmp(bx::Dir::Temp);