Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #22: Implement sorting using a struct to hold the state of the sorting #43

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
33 changes: 33 additions & 0 deletions internal/gocovshtest/happy_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,37 @@ func testHappyFlow(t *testing.T, prefix string, requestedFiles []string, filtere
g.Assert(t, "happy_flow_toggle_help_short", []byte(mm.View()))
})
})

t.Run("toggle sort", func(t *testing.T) {
t.Run("percentage", func(t *testing.T) {
mm, cmd := mt.sendLetterKey('s')
require.NotNil(t, mm)
require.Nil(t, cmd)

g.Assert(t, "happy_flow_toggle_sort_percentage", []byte(mm.View()))
})

t.Run("name", func(t *testing.T) {
mm, cmd := mt.sendLetterKey('s')
require.NotNil(t, mm)
require.Nil(t, cmd)

g.Assert(t, "happy_flow_toggle_sort_name", []byte(mm.View()))
})

t.Run("dsc", func(t *testing.T) {
mm, cmd := mt.sendLetterKey('!')
require.NotNil(t, mm)
require.Nil(t, cmd)

g.Assert(t, "happy_flow_toggle_sort_dsc", []byte(mm.View()))
})
t.Run("asc", func(t *testing.T) {
mm, cmd := mt.sendLetterKey('!')
require.NotNil(t, mm)
require.Nil(t, cmd)

g.Assert(t, "happy_flow_toggle_sort_asc", []byte(mm.View()))
})
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

2 items
covered.go 100.00%
> partial_with_a_very_long_name_to_trigger_ellipsis_in_the_output.go 75.00%











↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

2 items
partial_with_a_very_long_name_to_trigger_ellipsis_in_the_output.go 75.00%
> covered.go 100.00%











↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

2 items
covered.go 100.00%
> partial_with_a_very_long_name_to_trigger_ellipsis_in_the_output.go 75.00%











↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

2 items
covered.go 100.00%
> partial_with_a_very_long_name_to_trigger_ellipsis_in_the_output.go 75.00%











↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Available files:

1 item
> covered.go 100.00%












↑/k up • ↓/j down • / filter • q quit • ? more

Loading