test: improve coverage

This commit is contained in:
Aleksey Kulikov 2021-10-15 17:37:38 +03:00
parent d75acbfdd3
commit d6eae1e9ed
71 changed files with 710 additions and 229 deletions

View file

@ -69,12 +69,15 @@ void main() {
odb.free();
});
test('successfully packs into provided path', () {
test('successfully packs into provided path with threads set', () {
final odb = repo.odb;
final objectsCount = odb.objects.length;
Directory('${repo.workdir}test-pack').createSync();
final writtenCount = repo.pack(path: '${repo.workdir}test-pack');
final writtenCount = repo.pack(
path: '${repo.workdir}test-pack',
threads: 1,
);
expect(writtenCount, objectsCount);
expect(
Directory('${repo.workdir}test-pack').listSync().isNotEmpty,
@ -101,5 +104,11 @@ void main() {
final writtenCount = repo.pack(packDelegate: packDelegate);
expect(writtenCount, 18);
});
test('returns string representation of PackBuilder object', () {
final packbuilder = PackBuilder(repo);
expect(packbuilder.toString(), contains('PackBuilder{'));
packbuilder.free();
});
});
}