Skip to content

Commit

Permalink
Fixed unnecessary mutex definition
Browse files Browse the repository at this point in the history
  • Loading branch information
noborus committed Oct 23, 2023
1 parent 3cb2a8f commit 7435a44
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions oviewer/input_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package oviewer

import (
"sync"
"testing"

"github.com/gdamore/tcell/v2"
Expand Down Expand Up @@ -117,7 +116,6 @@ func TestInput_keyEvent(t *testing.T) {

func Test_candidate_up(t *testing.T) {
type fields struct {
mux sync.Mutex
list []string
p int
}
Expand Down Expand Up @@ -145,11 +143,9 @@ func Test_candidate_up(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &candidate{
mux: tt.fields.mux,
list: tt.fields.list,
p: tt.fields.p,
}
c := searchCandidate()
c.list = tt.fields.list
c.p = tt.fields.p
if got := c.up(); got != tt.want {
t.Errorf("candidate.up() = %v, want %v", got, tt.want)
}
Expand All @@ -159,7 +155,6 @@ func Test_candidate_up(t *testing.T) {

func Test_candidate_down(t *testing.T) {
type fields struct {
mux sync.Mutex
list []string
p int
}
Expand Down Expand Up @@ -187,11 +182,9 @@ func Test_candidate_down(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &candidate{
mux: tt.fields.mux,
list: tt.fields.list,
p: tt.fields.p,
}
c := searchCandidate()
c.list = tt.fields.list
c.p = tt.fields.p
if got := c.down(); got != tt.want {
t.Errorf("candidate.down() = %v, want %v", got, tt.want)
}
Expand Down

0 comments on commit 7435a44

Please sign in to comment.