diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/unittest/clangcodemodelserver-test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/unittest/clangcodemodelserver-test.cpp b/tests/unit/unittest/clangcodemodelserver-test.cpp index ea4238975e..bde56e2160 100644 --- a/tests/unit/unittest/clangcodemodelserver-test.cpp +++ b/tests/unit/unittest/clangcodemodelserver-test.cpp @@ -258,6 +258,21 @@ TEST_F(ClangCodeModelServerSlowTest, NoInitialAnnotationsForClosedDocument) closeDocument(filePathA); } +TEST_F(ClangCodeModelServerSlowTest, AnnotationsForInitiallyNotVisibleDocument) +{ + const int expectedAnnotationsCount = 2; + updateProjectPart(); + updateVisibilty(filePathA, filePathA); + expectAnnotations(expectedAnnotationsCount); + clangServer.documentsOpened( // Open document while another is still visible + DocumentsOpenedMessage({FileContainer(filePathB, projectPartId, Utf8String(), false, 1)}, + filePathA, {filePathA})); + clangServer.unsavedFilesUpdated( // Invalidate added jobs + UnsavedFilesUpdatedMessage({FileContainer(Utf8StringLiteral("aFile"), Utf8String())})); + + updateVisibilty(filePathB, filePathB); +} + TEST_F(ClangCodeModelServerSlowTest, NoAnnotationsForClosedDocument) { const int expectedAnnotationsCount = AnnotationJobsMultiplier; // Only for registration. |