From 4335dc7ff83378d0eb3c93e5bbc3247e5a3ac578 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 29 Mar 2018 18:43:20 +0200 Subject: [PATCH] Clang: More tests for symbol indexing Change-Id: Ic0806fbf245c9b69f74eaa8e3d52cad90dafedbf Reviewed-by: Ivan Donchevskii --- tests/unit/unittest/symbolindexing-test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit/unittest/symbolindexing-test.cpp b/tests/unit/unittest/symbolindexing-test.cpp index aa8452ecfb2..e72e43149ad 100644 --- a/tests/unit/unittest/symbolindexing-test.cpp +++ b/tests/unit/unittest/symbolindexing-test.cpp @@ -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))); +} + }