feat(reference): add ability to compare references

This commit is contained in:
Aleksey Kulikov 2021-08-09 12:08:58 +03:00
parent 1f0201d259
commit 7b6e0c36f6
3 changed files with 30 additions and 0 deletions

View file

@ -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);