refactor(repository)!: use Finalizer to automatically free allocated memory (#51)

BREAKING CHANGE: Return value of identity getter changed from Map<String, String> to Identity
This commit is contained in:
Aleksey Kulikov 2022-05-02 15:33:31 +03:00 committed by GitHub
parent aef440e345
commit 4e55d0f06c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 109 additions and 151 deletions

View file

@ -20,10 +20,6 @@ void main() {
repo = Repository.open(p.join('test', 'assets', 'empty_bare.git'));
});
tearDown(() {
repo.free();
});
test('opens successfully', () {
expect(repo, isA<Repository>());
});
@ -52,10 +48,6 @@ void main() {
);
});
tearDown(() {
repo.free();
});
test('opens standart repository from working directory successfully', () {
expect(repo, isA<Repository>());
});
@ -89,12 +81,18 @@ void main() {
test('sets identity ', () {
repo.setIdentity(name: 'name', email: 'email@email.com');
expect(repo.identity, {'name': 'email@email.com'});
final identity = repo.identity;
expect(identity.name, 'name');
expect(identity.email, 'email@email.com');
});
test('unsets identity', () {
repo.setIdentity(name: null, email: null);
expect(repo.identity, isEmpty);
final identity = repo.identity;
expect(identity.name, '');
expect(identity.email, '');
});
test('checks if shallow clone', () {