[clang-tools-extra] 5c14940 - [clangd] Remove a test with a duplicate of FileCacheTests
Yuki Okushi via cfe-commits
cfe-commits at lists.llvm.org
Tue May 31 16:16:38 PDT 2022
Author: Yuki Okushi
Date: 2022-06-01T08:15:54+09:00
New Revision: 5c14940394919cbc66cab06103342610af69bc58
URL: https://github.com/llvm/llvm-project/commit/5c14940394919cbc66cab06103342610af69bc58
DIFF: https://github.com/llvm/llvm-project/commit/5c14940394919cbc66cab06103342610af69bc58.diff
LOG: [clangd] Remove a test with a duplicate of FileCacheTests
FIXME says it should be removed so followed it.
Differential Revision: https://reviews.llvm.org/D126608
Added:
Modified:
clang-tools-extra/clangd/unittests/ConfigProviderTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/unittests/ConfigProviderTests.cpp b/clang-tools-extra/clangd/unittests/ConfigProviderTests.cpp
index 22f69143dadfa..36a9c383e058e 100644
--- a/clang-tools-extra/clangd/unittests/ConfigProviderTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ConfigProviderTests.cpp
@@ -178,44 +178,6 @@ TEST(ProviderTest, FromAncestorRelativeYAMLFiles) {
EXPECT_THAT(getAddedArgs(Cfg), ElementsAre("bar", "baz"));
}
-// FIXME: delete this test, it's covered by FileCacheTests.
-TEST(ProviderTest, Staleness) {
- MockFS FS;
-
- auto StartTime = std::chrono::steady_clock::now();
- Params StaleOK;
- StaleOK.FreshTime = StartTime;
- Params MustBeFresh;
- MustBeFresh.FreshTime = StartTime + std::chrono::hours(1);
- CapturedDiags Diags;
- auto P = Provider::fromYAMLFile(testPath("foo.yaml"), /*Directory=*/"", FS);
-
- // Initial query always reads, regardless of policy.
- FS.Files["foo.yaml"] = AddFooWithErr;
- auto Cfg = P->getConfig(StaleOK, Diags.callback());
- EXPECT_THAT(Diags.Diagnostics,
- ElementsAre(diagMessage("Unknown CompileFlags key 'Unknown'")));
- EXPECT_THAT(getAddedArgs(Cfg), ElementsAre("foo"));
- Diags.clear();
-
- // Stale value reused by policy.
- FS.Files["foo.yaml"] = AddBarBaz;
- Cfg = P->getConfig(StaleOK, Diags.callback());
- EXPECT_THAT(Diags.Diagnostics, IsEmpty()) << "Cached, not re-parsed";
- EXPECT_THAT(getAddedArgs(Cfg), ElementsAre("foo"));
-
- // Cache revalidated by policy.
- Cfg = P->getConfig(MustBeFresh, Diags.callback());
- EXPECT_THAT(Diags.Diagnostics, IsEmpty()) << "New config, no errors";
- EXPECT_THAT(getAddedArgs(Cfg), ElementsAre("bar", "baz"));
-
- // Cache revalidated by (default) policy.
- FS.Files.erase("foo.yaml");
- Cfg = P->getConfig(Params(), Diags.callback());
- EXPECT_THAT(Diags.Diagnostics, IsEmpty());
- EXPECT_THAT(getAddedArgs(Cfg), IsEmpty());
-}
-
TEST(ProviderTest, SourceInfo) {
MockFS FS;
More information about the cfe-commits
mailing list