mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(patch): add binding and API method for git_patch_line_stats (#39)
This commit is contained in:
parent
06cc0230c7
commit
432abffa89
3 changed files with 79 additions and 4 deletions
|
@ -163,6 +163,23 @@ index e69de29..0000000
|
|||
expect(() => Patch(nullptr).text, throwsA(isA<LibGit2Error>()));
|
||||
});
|
||||
|
||||
test('returns line counts of each type in a patch', () {
|
||||
final patch = Patch.fromBuffers(
|
||||
oldBuffer: oldBuffer,
|
||||
newBuffer: newBuffer,
|
||||
oldBufferPath: path,
|
||||
newBufferPath: path,
|
||||
);
|
||||
|
||||
final stats = patch.stats;
|
||||
expect(stats.context, equals(0));
|
||||
expect(stats.insertions, equals(1));
|
||||
expect(stats.deletions, equals(0));
|
||||
expect(stats.toString(), contains('PatchStats{'));
|
||||
|
||||
patch.free();
|
||||
});
|
||||
|
||||
test('returns string representation of Patch object', () {
|
||||
final patch = Patch.fromBuffers(
|
||||
oldBuffer: oldBuffer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue