Skip to content

Commit b601100

Browse files
kadircettstellar
authored andcommitted
[clangd] Fix windows buildbots after ecea721
(cherry picked from commit cdef5a7)
1 parent d840463 commit b601100

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

clang-tools-extra/clangd/support/Path.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ bool pathEqual(PathRef A, PathRef B) { return A == B; }
2121

2222
bool pathStartsWith(PathRef Ancestor, PathRef Path,
2323
llvm::sys::path::Style Style) {
24-
assert(llvm::sys::path::is_absolute(Ancestor, Style) &&
25-
llvm::sys::path::is_absolute(Path, Style));
24+
assert(llvm::sys::path::is_absolute(Ancestor) &&
25+
llvm::sys::path::is_absolute(Path));
2626
// If ancestor ends with a separator drop that, so that we can match /foo/ as
2727
// a parent of /foo.
2828
if (llvm::sys::path::is_separator(Ancestor.back(), Style))

clang-tools-extra/clangd/unittests/support/PathTests.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "TestFS.h"
910
#include "support/Path.h"
1011
#include "gmock/gmock.h"
1112
#include "gtest/gtest.h"
@@ -14,21 +15,21 @@ namespace clang {
1415
namespace clangd {
1516
namespace {
1617
TEST(PathTests, IsAncestor) {
17-
EXPECT_TRUE(pathStartsWith("/foo", "/foo"));
18-
EXPECT_TRUE(pathStartsWith("/foo/", "/foo"));
18+
EXPECT_TRUE(pathStartsWith(testPath("foo"), testPath("foo")));
19+
EXPECT_TRUE(pathStartsWith(testPath("foo/"), testPath("foo")));
1920

20-
EXPECT_FALSE(pathStartsWith("/foo", "/fooz"));
21-
EXPECT_FALSE(pathStartsWith("/foo/", "/fooz"));
21+
EXPECT_FALSE(pathStartsWith(testPath("foo"), testPath("fooz")));
22+
EXPECT_FALSE(pathStartsWith(testPath("foo/"), testPath("fooz")));
2223

23-
EXPECT_TRUE(pathStartsWith("/foo", "/foo/bar"));
24-
EXPECT_TRUE(pathStartsWith("/foo/", "/foo/bar"));
24+
EXPECT_TRUE(pathStartsWith(testPath("foo"), testPath("foo/bar")));
25+
EXPECT_TRUE(pathStartsWith(testPath("foo/"), testPath("foo/bar")));
2526

2627
#ifdef CLANGD_PATH_CASE_INSENSITIVE
27-
EXPECT_TRUE(pathStartsWith("/fOo", "/foo/bar"));
28-
EXPECT_TRUE(pathStartsWith("/foo", "/fOo/bar"));
28+
EXPECT_TRUE(pathStartsWith(testPath("fOo"), testPath("foo/bar")));
29+
EXPECT_TRUE(pathStartsWith(testPath("foo"), testPath("fOo/bar")));
2930
#else
30-
EXPECT_FALSE(pathStartsWith("/fOo", "/foo/bar"));
31-
EXPECT_FALSE(pathStartsWith("/foo", "/fOo/bar"));
31+
EXPECT_FALSE(pathStartsWith(testPath("fOo"), testPath("foo/bar")));
32+
EXPECT_FALSE(pathStartsWith(testPath("foo"), testPath("fOo/bar")));
3233
#endif
3334
}
3435
} // namespace

0 commit comments

Comments
 (0)