diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/history/MercurialRepositoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/history/MercurialRepositoryTest.java index 11a3e4470a3..dd2917f2f04 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/history/MercurialRepositoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/history/MercurialRepositoryTest.java @@ -47,7 +47,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Date; import java.util.List; import java.util.Objects; import java.util.Set; @@ -476,4 +475,18 @@ void testBuildTagListInitial() throws Exception { expectedTags.add(tagEntry); assertEquals(expectedTags, tags); } + + @Test + void testBuildTagListOneMore() throws Exception { + MercurialRepository hgRepo = (MercurialRepository) RepositoryFactory.getRepository(repositoryRoot); + assertNotNull(hgRepo); + runHgCommand(repositoryRoot, "tag", "foo"); + hgRepo.buildTagList(new File(hgRepo.getDirectoryName()), CommandTimeoutType.INDEXER); + var tags = hgRepo.getTagList(); + assertNotNull(tags); + assertEquals(2, tags.size()); + Set expectedTags = Set.of(new MercurialTagEntry(7, "start_of_novel"), + new MercurialTagEntry(9, "foo")); + assertEquals(expectedTags, tags); + } }