Skip to content

Commit

Permalink
fix navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
brenol committed Oct 18, 2020
1 parent d259d7c commit 479f017
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/dgryski/go-gk v0.0.0-20140819190930-201884a44051 h1:ByJUvQYyTtNNCVfYNM48q6uYUT4fAlN0wNmd3th4BSo=
github.com/dgryski/go-gk v0.0.0-20140819190930-201884a44051/go.mod h1:qm+vckxRlDt0aOla0RYJJVeqHZlWfOm2UIxHaqPB46E=
github.com/dgryski/go-lttb v0.0.0-20180810165845-318fcdf10a77/go.mod h1:Va5MyIzkU0rAM92tn3hb3Anb7oz7KcnixF49+2wOMe4=
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell v1.3.0 h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM=
github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM=
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
Expand Down Expand Up @@ -47,6 +49,7 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lucasb-eyer/go-colorful v1.0.2 h1:mCMFu6PgSozg9tDNMMK3g18oJBX7oYGrC09mS6CXfO4=
github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s=
github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
Expand Down
2 changes: 1 addition & 1 deletion gui/keybinds.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func navigateCharts(chartFuncs []func()) func(bool) {
position := -1
position := 0
numFuncs := len(chartFuncs)
return func(backwards bool) {
position++
Expand Down
8 changes: 4 additions & 4 deletions gui/keybinds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestNavigateCharts(t *testing.T) {
},
},
{
name: "Navigate functions ",
name: "Navigate functions",
funcs: func(st *test) []func() {
return []func(){
func() { st.modifiedByFuncs += "a" },
Expand All @@ -95,7 +95,7 @@ func TestNavigateCharts(t *testing.T) {
callTimes: 5,
backwards: false,
assert: func(t *testing.T, tst *test) {
want := "ababa"
want := "babab"
if tst.modifiedByFuncs != want {
t.Errorf("unexpected result of modifiedByFuncs: want: %s; got: %s", want, tst.modifiedByFuncs)
}
Expand Down Expand Up @@ -134,7 +134,7 @@ func TestNavigateCharts(t *testing.T) {
callTimes: 10,
backwards: false,
assert: func(t *testing.T, tst *test) {
want := "abcdeabcde"
want := "bcdeabcdea"
if tst.modifiedByFuncs != want {
t.Errorf("unexpected result of modifiedByFuncs: want: %s; got: %s", want, tst.modifiedByFuncs)
}
Expand All @@ -161,7 +161,7 @@ func TestNavigateCharts(t *testing.T) {
callTimes: 10,
backwards: false,
assert: func(t *testing.T, tst *test) {
want := "ababababab"
want := "bababababa"
if tst.modifiedByFuncs != want {
t.Errorf("unexpected result of modifiedByFuncs: want: %s; got: %s", want, tst.modifiedByFuncs)
}
Expand Down

0 comments on commit 479f017

Please sign in to comment.