mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Use an interface for tasks instead of a concrete struct
By using an interface for tasks we can use a fake implementation in tests with extra methods
This commit is contained in:
@ -13,8 +13,8 @@ func TestAsyncHandler(t *testing.T) {
|
||||
wg := sync.WaitGroup{}
|
||||
wg.Add(2)
|
||||
|
||||
onWorker := func(f func(*gocui.Task)) {
|
||||
go f(&gocui.Task{})
|
||||
onWorker := func(f func(gocui.Task)) {
|
||||
go f(gocui.NewFakeTask())
|
||||
}
|
||||
handler := NewAsyncHandler(onWorker)
|
||||
handler.onReject = func() {
|
||||
|
Reference in New Issue
Block a user