Skip to content

Commit

Permalink
[unittest] Use UnorderedElementsAre for StringMap keys
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Feb 2, 2023
1 parent 70ff191 commit 16c8709
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
Expand Up @@ -580,8 +580,9 @@ TEST_F(BackgroundIndexTest, UncompilableFiles) {
CDB.setCompileCommand(testPath("build/../A.cc"), Cmd);
ASSERT_TRUE(Idx.blockUntilIdleForTest());

EXPECT_THAT(Storage.keys(), ElementsAre(testPath("A.cc"), testPath("A.h"),
testPath("B.h"), testPath("C.h")));
EXPECT_THAT(Storage.keys(),
UnorderedElementsAre(testPath("A.cc"), testPath("A.h"),
testPath("B.h"), testPath("C.h")));

{
auto Shard = MSS.loadShard(testPath("A.cc"));
Expand Down Expand Up @@ -635,7 +636,8 @@ TEST_F(BackgroundIndexTest, CmdLineHash) {
CDB.setCompileCommand(testPath("build/../A.cc"), Cmd);
ASSERT_TRUE(Idx.blockUntilIdleForTest());

EXPECT_THAT(Storage.keys(), ElementsAre(testPath("A.cc"), testPath("A.h")));
EXPECT_THAT(Storage.keys(),
UnorderedElementsAre(testPath("A.cc"), testPath("A.h")));
// Make sure we only store the Cmd for main file.
EXPECT_FALSE(MSS.loadShard(testPath("A.h"))->Cmd);

Expand Down

0 comments on commit 16c8709

Please sign in to comment.