diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-19 16:34:46 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-24 20:14:41 +1100 |
commit | bf4f06ab4e6ceefe388e0efefcc553526f3d96c2 (patch) | |
tree | b4cfdb71e31fa7d960722f192a56e5fb1a483e5e /pkg/gui/presentation | |
parent | eda8f4a5d4302691d99efd066f9851809c984bc0 (diff) |
more generics
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r-- | pkg/gui/presentation/commits_test.go | 87 |
1 files changed, 48 insertions, 39 deletions
diff --git a/pkg/gui/presentation/commits_test.go b/pkg/gui/presentation/commits_test.go index 846d50d19..d2acaeba2 100644 --- a/pkg/gui/presentation/commits_test.go +++ b/pkg/gui/presentation/commits_test.go @@ -38,13 +38,14 @@ func TestGetCommitListDisplayStrings(t *testing.T) { focus bool }{ { - testName: "no commits", - commits: []*models.Commit{}, - startIdx: 0, - length: 1, - showGraph: false, - bisectInfo: git_commands.NewNullBisectInfo(), - expected: "", + testName: "no commits", + commits: []*models.Commit{}, + startIdx: 0, + length: 1, + showGraph: false, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), + expected: "", }, { testName: "some commits", @@ -52,10 +53,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit1", Sha: "sha1"}, {Name: "commit2", Sha: "sha2"}, }, - startIdx: 0, - length: 2, - showGraph: false, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 0, + length: 2, + showGraph: false, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha1 commit1 sha2 commit2 @@ -70,10 +72,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}}, {Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}}, }, - startIdx: 0, - length: 5, - showGraph: true, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 0, + length: 5, + showGraph: true, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha1 ⏣─╮ commit1 sha2 ◯ │ commit2 @@ -91,10 +94,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}}, {Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}}, }, - startIdx: 0, - length: 5, - showGraph: true, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 0, + length: 5, + showGraph: true, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha1 pick commit1 sha2 pick commit2 @@ -112,10 +116,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}}, {Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}}, }, - startIdx: 1, - length: 10, - showGraph: true, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 1, + length: 10, + showGraph: true, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha2 pick commit2 sha3 ◯ commit3 @@ -132,10 +137,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}}, {Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}}, }, - startIdx: 3, - length: 2, - showGraph: true, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 3, + length: 2, + showGraph: true, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha4 ◯ commit4 sha5 ◯ commit5 @@ -150,10 +156,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}}, {Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}}, }, - startIdx: 0, - length: 2, - showGraph: true, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 0, + length: 2, + showGraph: true, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha1 pick commit1 sha2 pick commit2 @@ -168,10 +175,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}}, {Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}}, }, - startIdx: 4, - length: 2, - showGraph: true, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 4, + length: 2, + showGraph: true, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha5 ◯ commit5 `), @@ -185,10 +193,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { {Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}, Action: "pick"}, {Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}}, }, - startIdx: 0, - length: 2, - showGraph: true, - bisectInfo: git_commands.NewNullBisectInfo(), + startIdx: 0, + length: 2, + showGraph: true, + bisectInfo: git_commands.NewNullBisectInfo(), + cherryPickedCommitShaSet: set.New[string](), expected: formatExpected(` sha1 pick commit1 sha2 pick commit2 |