[clang-tools-extra] r336249 - Try to fix FileDistance test on windows.
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 4 02:08:40 PDT 2018
Author: ioeric
Date: Wed Jul 4 02:08:40 2018
New Revision: 336249
URL: http://llvm.org/viewvc/llvm-project?rev=336249&view=rev
Log:
Try to fix FileDistance test on windows.
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11510/steps/ninja%20check%201/logs/FAIL%3A%20Extra%20Tools%20Unit%20Tests%3A%3AFileDistanceTests.URI
Modified:
clang-tools-extra/trunk/unittests/clangd/FileDistanceTests.cpp
Modified: clang-tools-extra/trunk/unittests/clangd/FileDistanceTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/FileDistanceTests.cpp?rev=336249&r1=336248&r2=336249&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/FileDistanceTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/FileDistanceTests.cpp Wed Jul 4 02:08:40 2018
@@ -67,9 +67,15 @@ TEST(FileDistanceTests, URI) {
SourceParams CostLots;
CostLots.Cost = 1000;
- URIDistance D(
- {{testPath("foo"), CostLots}, {"/not/a/testpath", SourceParams()}}, Opts);
+ URIDistance D({{testPath("foo"), CostLots},
+ {"/not/a/testpath", SourceParams()},
+ {"C:\\not\\a\\testpath", SourceParams()}},
+ Opts);
+#ifdef _WIN32
+ EXPECT_EQ(D.distance("file:///C%3a/not/a/testpath/either"), 3u);
+#else
EXPECT_EQ(D.distance("file:///not/a/testpath/either"), 3u);
+#endif
EXPECT_EQ(D.distance("unittest:foo"), 1000u);
EXPECT_EQ(D.distance("unittest:bar"), 1008u);
}
More information about the cfe-commits
mailing list