diff --git a/test/tag_test.dart b/test/tag_test.dart index 263ed32c..ce7a47cc 100644 --- a/test/tag_test.dart +++ b/test/tag_test.dart @@ -23,14 +23,22 @@ void main() { test('Parse annotated tag', () async { final testDir = await createTempGitDir(); - final contents = {'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, ); @@ -39,8 +47,8 @@ void main() { 'tag', '--annotate', '--message', - 'First tag', - 'anotherTag', + 'Second tag', + anotherTagName, branchRef.sha, ], processWorkingDir: testDir.path, @@ -48,5 +56,10 @@ void main() { 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')); }); }