aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/unittest/symbolindexer-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/unittest/symbolindexer-test.cpp')
-rw-r--r--tests/unit/unittest/symbolindexer-test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/unittest/symbolindexer-test.cpp b/tests/unit/unittest/symbolindexer-test.cpp
index a03f2be507..2db11dc5fb 100644
--- a/tests/unit/unittest/symbolindexer-test.cpp
+++ b/tests/unit/unittest/symbolindexer-test.cpp
@@ -922,6 +922,21 @@ TEST_F(SymbolIndexer, DependentSourceAreUpToDate)
indexer.updateProjectParts({projectPart1});
}
+TEST_F(SymbolIndexer, SourcesAreWatched)
+{
+ using ClangBackEnd::IdPaths;
+ InSequence s;
+ FilePathIds sourcePathIds{4, 6, 8};
+
+ EXPECT_CALL(mockBuildDependenciesStorage, fetchSources(projectPart1.projectPartId))
+ .WillOnce(Return(sourcePathIds));
+ EXPECT_CALL(mockPathWatcher,
+ updateIdPaths(ElementsAre(AllOf(Field(&IdPaths::id, projectPart1.projectPartId),
+ Field(&IdPaths::filePathIds, sourcePathIds)))));
+
+ indexer.updateProjectParts({projectPart1});
+}
+
TEST_F(SymbolIndexer, CallSetNotifier)
{
EXPECT_CALL(mockPathWatcher, setNotifier(_));