mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 02:51:57 +00:00
Add unit test for IsWindowsAbsolutePath
This commit is contained in:
parent
99904874ca
commit
26e50e695d
@ -23,6 +23,7 @@
|
||||
#include <sstream>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
struct CompileCommandsEntry {
|
||||
std::string directory;
|
||||
@ -1480,6 +1481,22 @@ TEST_SUITE("Project") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("IsWindowsAbsolutePath works correctly") {
|
||||
REQUIRE(IsWindowsAbsolutePath("C:/Users/projects/") == true);
|
||||
REQUIRE(IsWindowsAbsolutePath("C:/Users/projects") == true);
|
||||
REQUIRE(IsWindowsAbsolutePath("C:/Users/projects") == true);
|
||||
REQUIRE(IsWindowsAbsolutePath("C:\\Users\\projects") == true);
|
||||
REQUIRE(IsWindowsAbsolutePath("C:\\\\Users\\\\projects") == true);
|
||||
REQUIRE(IsWindowsAbsolutePath("c:\\\\Users\\\\projects") == true);
|
||||
REQUIRE(IsWindowsAbsolutePath("A:\\\\Users\\\\projects") == true);
|
||||
|
||||
REQUIRE(IsWindowsAbsolutePath("C:/") == false);
|
||||
REQUIRE(IsWindowsAbsolutePath("../abc/test") == false);
|
||||
REQUIRE(IsWindowsAbsolutePath("5:/test") == false);
|
||||
REQUIRE(IsWindowsAbsolutePath("cquery/project/file.cc") == false);
|
||||
REQUIRE(IsWindowsAbsolutePath("") == false);
|
||||
}
|
||||
|
||||
TEST_CASE("Entry inference prefers same file endings") {
|
||||
Project p;
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user