mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
test(reference): add tests for symbolic refs
This commit is contained in:
parent
2f896e6180
commit
6643527f2d
3 changed files with 40 additions and 8 deletions
|
@ -33,6 +33,10 @@ void main() {
|
|||
test('returns correct type of reference', () {
|
||||
expect(repo.head.type, ReferenceType.direct);
|
||||
repo.head.free();
|
||||
|
||||
final ref = Reference.lookup(repo, 'HEAD');
|
||||
expect(ref.type, ReferenceType.symbolic);
|
||||
ref.free();
|
||||
});
|
||||
|
||||
test('returns SHA hex of direct reference', () {
|
||||
|
@ -40,6 +44,12 @@ void main() {
|
|||
repo.head.free();
|
||||
});
|
||||
|
||||
test('returns SHA hex of symbolic reference', () {
|
||||
final ref = Reference.lookup(repo, 'HEAD');
|
||||
expect(ref.target, lastCommit);
|
||||
ref.free();
|
||||
});
|
||||
|
||||
test('returns the full name of a reference', () {
|
||||
expect(repo.head.name, 'refs/heads/master');
|
||||
repo.head.free();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue