diff options
author | mjarkk <mkopenga@gmail.com> | 2021-08-06 21:50:53 +0200 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2021-08-06 21:50:58 +0200 |
commit | ea136e4e77259e27db0b89a88d7d57cad6062d1e (patch) | |
tree | bdea3d6e37ab6669b4a102850ff9702c55612ea6 /pkg/gui/gui_test.go | |
parent | dcd3b7c058f9c1289234c2ec174d6dd9802e96e2 (diff) |
Improve code quality
- Make CommandMenuEntry private
- create candidates only once we really need it
- Use only 1 buffer
- Clearify CommandMenuEntry creation fields
Diffstat (limited to 'pkg/gui/gui_test.go')
-rw-r--r-- | pkg/gui/gui_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/gui_test.go b/pkg/gui/gui_test.go index e3989ba24..a50f093be 100644 --- a/pkg/gui/gui_test.go +++ b/pkg/gui/gui_test.go @@ -88,7 +88,7 @@ func TestGuiGenerateMenuCandidates(t *testing.T) { filter string valueFormat string labelFormat string - test func([]CommandMenuEntry, error) + test func([]commandMenuEntry, error) } scenarios := []scenario{ @@ -98,7 +98,7 @@ func TestGuiGenerateMenuCandidates(t *testing.T) { "(?P<remote>[a-z_]+)/(?P<branch>.*)", "{{ .branch }}", "Remote: {{ .remote }}", - func(actualEntry []CommandMenuEntry, err error) { + func(actualEntry []commandMenuEntry, err error) { assert.NoError(t, err) assert.EqualValues(t, "pr-1", actualEntry[0].value) assert.EqualValues(t, "Remote: upstream", actualEntry[0].label) @@ -110,7 +110,7 @@ func TestGuiGenerateMenuCandidates(t *testing.T) { "(?P<remote>[a-z]*)/(?P<branch>.*)", "{{ .branch }}|{{ .remote }}", "", - func(actualEntry []CommandMenuEntry, err error) { + func(actualEntry []commandMenuEntry, err error) { assert.NoError(t, err) assert.EqualValues(t, "pr-1|upstream", actualEntry[0].value) assert.EqualValues(t, "pr-1|upstream", actualEntry[0].label) @@ -122,7 +122,7 @@ func TestGuiGenerateMenuCandidates(t *testing.T) { "(?P<remote>[a-z]*)/(?P<branch>.*)", "{{ .group_2 }}|{{ .group_1 }}", "Remote: {{ .group_1 }}", - func(actualEntry []CommandMenuEntry, err error) { + func(actualEntry []commandMenuEntry, err error) { assert.NoError(t, err) assert.EqualValues(t, "pr-1|upstream", actualEntry[0].value) assert.EqualValues(t, "Remote: upstream", actualEntry[0].label) |