[clang-tools-extra] [clangd][test] Fix test failures when LLVM_WINDOWS_PREFER_FORWARD_SLA… (PR #193160)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 05:05:43 PDT 2026


================
@@ -133,8 +133,15 @@ TEST(URITest, ParseFailed) {
 
 TEST(URITest, Resolve) {
 #ifdef _WIN32
-  EXPECT_THAT(resolveOrDie(parseOrDie("file:///c%3a/x/y/z")), "c:\\x\\y\\z");
-  EXPECT_THAT(resolveOrDie(parseOrDie("file:///c:/x/y/z")), "c:\\x\\y\\z");
+  // Expected path style depends on LLVM_WINDOWS_PREFER_FORWARD_SLASH.
+  auto Native = [](llvm::StringRef Path) {
----------------
zmodem wrote:

Maybe turn the lambda into a proper function that the other test can use as well?

Actually, since we're doing this a lot, maybe there should just be a `llvm::sys::path::native` overload that returns a `std::string` instead of doing the transformation in-pace..

https://github.com/llvm/llvm-project/pull/193160


More information about the cfe-commits mailing list