mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -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
|
@ -31,19 +31,11 @@ int listEntryCount(Pointer<git_status_list> statuslist) {
|
|||
/// Get a pointer to one of the entries in the status list.
|
||||
///
|
||||
/// The entry is not modifiable and should not be freed.
|
||||
///
|
||||
/// Throws [RangeError] if position is out of bounds
|
||||
Pointer<git_status_entry> getByIndex({
|
||||
required Pointer<git_status_list> statuslistPointer,
|
||||
required int index,
|
||||
}) {
|
||||
final result = libgit2.git_status_byindex(statuslistPointer, index);
|
||||
|
||||
if (result == nullptr) {
|
||||
throw RangeError('Out of bounds');
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
return libgit2.git_status_byindex(statuslistPointer, index);
|
||||
}
|
||||
|
||||
/// Get file status for a single file.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue