Skip to content

Commit

Permalink
Add check of tag content to annotated tag test
Browse files Browse the repository at this point in the history
  • Loading branch information
John McMahon committed Jan 1, 2024
1 parent e66669b commit 4f730b9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/tag_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ void main() {

test('Parse annotated tag', () async {
final testDir = await createTempGitDir();

final contents = <String, String>{'something': 'value'};
const newTagName = 'newTag';
const anotherTagName = 'anotherTag';

await doDescriptorGitCommit(testDir, contents, 'Something');
final branchRef = await testDir.currentBranch();

await runGit(
['tag', '--annotate', '--message', 'First tag', 'newTag', branchRef.sha],
[
'tag',
'--annotate',
'--message',
'First tag',
newTagName,
branchRef.sha
],
processWorkingDir: testDir.path,
);

Expand All @@ -39,14 +47,19 @@ void main() {
'tag',
'--annotate',
'--message',
'First tag',
'anotherTag',
'Second tag',
anotherTagName,
branchRef.sha,
],
processWorkingDir: testDir.path,
);

final tagsFound = await testDir.tags().toList();
expect(tagsFound, hasLength(2));

final alphabeticallyFirstTag = tagsFound.first;
expect(alphabeticallyFirstTag.tag, equals(anotherTagName));
expect(alphabeticallyFirstTag.objectSha, equals(branchRef.sha));
expect(alphabeticallyFirstTag.type, equals('commit'));
});
}

0 comments on commit 4f730b9

Please sign in to comment.