[llvm-branch-commits] [clang-tools-extra] 0336ff0 - [clangd] Fix broken JSON test on windows

Sam McCall via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 18 06:15:35 PST 2020


Author: Sam McCall
Date: 2020-12-18T15:11:08+01:00
New Revision: 0336ff0a17e6aec831334aeb50e6685f6b184065

URL: https://github.com/llvm/llvm-project/commit/0336ff0a17e6aec831334aeb50e6685f6b184065
DIFF: https://github.com/llvm/llvm-project/commit/0336ff0a17e6aec831334aeb50e6685f6b184065.diff

LOG: [clangd] Fix broken JSON test on windows

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
index d9fccb835c96..12c986572d8b 100644
--- a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
+++ b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
@@ -432,12 +432,13 @@ TEST_F(DirectoryBasedGlobalCompilationDatabaseCacheTest, Cacheable) {
   EXPECT_THAT(FooBar, hasFlag("-DFOOBAR")) << "cdb reloaded";
 
   // compile_commands.json takes precedence over compile_flags.txt.
-  FS.Files["foo/compile_commands.json"] = llvm::formatv(R"json([{
+  FS.Files["foo/compile_commands.json"] =
+      llvm::formatv(R"json([{
     "file": "{0}/foo/dummy.cc",
     "command": "clang -DBAZ dummy.cc",
     "directory": "{0}/foo",
   }])json",
-                                                        testRoot());
+                    llvm::sys::path::convert_to_slash(testRoot()));
   EXPECT_EQ(FooBar, lookupCDB(GDB, testPath("foo/test.cc"), Stale))
       << "cache still valid";
   auto Baz = lookupCDB(GDB, testPath("foo/test.cc"), Fresh);


        


More information about the llvm-branch-commits mailing list