mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reference): add ability to compare references
This commit is contained in:
parent
1f0201d259
commit
7b6e0c36f6
3 changed files with 30 additions and 0 deletions
|
@ -523,6 +523,21 @@ void main() {
|
|||
});
|
||||
});
|
||||
|
||||
test('checks equality', () {
|
||||
final ref1 = Reference.get(repo, 'refs/heads/master');
|
||||
final ref2 = Reference.get(repo, 'refs/heads/master');
|
||||
final ref3 = Reference.get(repo, 'refs/heads/feature');
|
||||
|
||||
expect(ref1 == ref2, true);
|
||||
expect(ref1 != ref2, false);
|
||||
expect(ref1 == ref3, false);
|
||||
expect(ref1 != ref3, true);
|
||||
|
||||
ref1.free();
|
||||
ref2.free();
|
||||
ref3.free();
|
||||
});
|
||||
|
||||
group('isValidName()', () {
|
||||
test('returns true for valid names', () {
|
||||
expect(Reference.isValidName('HEAD'), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue