mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
test: add more tests for throws and their messages
This commit is contained in:
parent
d6eae1e9ed
commit
127849519d
80 changed files with 2741 additions and 1501 deletions
|
@ -1,3 +1,4 @@
|
|||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:libgit2dart/libgit2dart.dart';
|
||||
|
@ -80,6 +81,19 @@ void main() {
|
|||
expect(repo.isEmpty, true);
|
||||
});
|
||||
|
||||
test('throws when checking if it is empty and error occurs', () {
|
||||
expect(
|
||||
() => Repository(nullptr).isEmpty,
|
||||
throwsA(
|
||||
isA<LibGit2Error>().having(
|
||||
(e) => e.toString(),
|
||||
'error',
|
||||
"invalid argument: 'repo'",
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
test('checks if head is detached', () {
|
||||
expect(repo.isHeadDetached, false);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue