[clangd] Fix broken JSON test on windows
authorSam McCall <sam.mccall@gmail.com>
Fri, 18 Dec 2020 14:11:08 +0000 (15:11 +0100)
committerSam McCall <sam.mccall@gmail.com>
Fri, 18 Dec 2020 14:11:08 +0000 (15:11 +0100)
clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp

index d9fccb8..12c9865 100644 (file)
@@ -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);