test: improve coverage (#44)

This commit is contained in:
Aleksey Kulikov 2022-01-26 16:11:38 +03:00 committed by GitHub
parent bad5e20581
commit 7b57c41253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 171 additions and 40 deletions

View file

@ -141,6 +141,17 @@ void main() {
expect(newReflog.length, 3);
});
test('throws when trying to write reflog to disk and error occurs', () {
final ref = Reference.lookup(repo: repo, name: 'refs/heads/feature');
final reflog = ref.log;
Reference.delete(repo: repo, name: ref.name);
expect(() => reflog.write(), throwsA(isA<LibGit2Error>()));
reflog.free();
ref.free();
});
test('returns string representation of RefLogEntry object', () {
expect(reflog[0].toString(), contains('RefLogEntry{'));
});