Clang: More tests for symbol indexing

Change-Id: Ic0806fbf245c9b69f74eaa8e3d52cad90dafedbf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-03-29 18:43:20 +02:00
parent d4ef90e632
commit 4335dc7ff8

View File

@@ -115,4 +115,17 @@ TEST_F(SymbolIndexing, DISABLED_TemplateFunction)
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 6, 5)));
}
TEST_F(SymbolIndexing, PathsAreUpdated)
{
indexing.indexer().updateProjectParts({projectPart1}, {});
indexing.indexer().pathsChanged({filePathId(main1Path)});
indexing.indexer().pathsChanged({filePathId(main1Path)});
auto locations = query.locationsAt(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 6, 5);
ASSERT_THAT(locations,
ElementsAre(
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 5, 9),
IsLocation(filePathId(TESTDATA_DIR "/symbolindexing_main1.cpp"), 6, 5)));
}
}