Skip to content

Commit e83b889

Browse files
committed
test the actual history value
1 parent 0535f17 commit e83b889

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/history/CVSHistoryParserTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import java.io.IOException;
3535
import java.io.InputStream;
3636
import java.net.URISyntaxException;
37+
import java.util.Date;
38+
import java.util.List;
3739
import java.util.Map;
3840

3941
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -171,11 +173,30 @@ void parseALaW3C() throws Exception {
171173
void testHistoryForDirectory() throws Exception {
172174
File repoRoot = setUpTestRepository();
173175
assertTrue(repoRoot.exists());
176+
assertTrue(repoRoot.isDirectory());
174177
CVSRepository repository = (CVSRepository) RepositoryFactory.getRepository(repoRoot);
175178
assertNotNull(repository);
176179
History history = repository.getHistory(repoRoot);
177180
assertNotNull(history);
178181
assertNotNull(history.getHistoryEntries());
179182
assertEquals(3, history.getHistoryEntries().size());
183+
184+
List<HistoryEntry> entries = List.of(
185+
new HistoryEntry("1.1.1.1", new Date(1220544581000L),
186+
"austvik",
187+
"Add files\n", true),
188+
new HistoryEntry("1.2", new Date(1220544684000L),
189+
"austvik",
190+
"Added a comment\n", true),
191+
new HistoryEntry("1.1", new Date(1220544581000L),
192+
"austvik",
193+
"branches: 1.1.1;\n" +
194+
"Initial revision\n", true)
195+
);
196+
197+
assertEquals(entries.size(), history.getHistoryEntries().size());
198+
History expectedHistory = new History(entries);
199+
expectedHistory.setTags(Map.of("1.1.1.1", "start"));
200+
assertEquals(expectedHistory, history);
180201
}
181202
}

0 commit comments

Comments
 (0)