mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
test: improve coverage
This commit is contained in:
parent
d75acbfdd3
commit
d6eae1e9ed
71 changed files with 710 additions and 229 deletions
|
@ -26,6 +26,7 @@ void main() {
|
|||
group('Tree', () {
|
||||
test('successfully initializes tree from provided Oid', () {
|
||||
expect(tree, isA<Tree>());
|
||||
expect(tree.toString(), contains('Tree{'));
|
||||
});
|
||||
|
||||
test('returns correct values', () {
|
||||
|
@ -55,6 +56,7 @@ void main() {
|
|||
test('returns tree entry with provided path to file', () {
|
||||
final entry = tree['dir/dir_file.txt'];
|
||||
expect(entry.oid.sha, 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391');
|
||||
expect(entry.toString(), contains('TreeEntry{'));
|
||||
entry.free();
|
||||
});
|
||||
|
||||
|
@ -62,6 +64,10 @@ void main() {
|
|||
expect(() => tree['invalid/path'], throwsA(isA<LibGit2Error>()));
|
||||
});
|
||||
|
||||
test('throws when looking up with invalid argument type', () {
|
||||
expect(() => tree[true], throwsA(isA<ArgumentError>()));
|
||||
});
|
||||
|
||||
test('successfully creates tree', () {
|
||||
final fileOid = repo.createBlob('blob content');
|
||||
final builder = TreeBuilder(repo: repo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue