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

@ -35,6 +35,19 @@ void main() {
expect(oid, isA<Oid>());
expect(oid.sha, sha);
});
test('throws when sha hex string is too short', () {
expect(
() => Oid.fromSHA(repo: repo, sha: 'sha'),
throwsA(
isA<ArgumentError>().having(
(e) => e.invalidValue,
'value',
'sha is not a valid sha hex string',
),
),
);
});
});
group('fromRaw()', () {
@ -72,5 +85,9 @@ void main() {
expect(oid1 >= oid2, true);
});
});
test('returns string representation of Oid object', () {
expect(repo[sha].toString(), contains('Oid{'));
});
});
}