@@ -15,7 +15,7 @@ func Test_BeforeCommandExecutionHook(t *testing.T) {
1515 var cfg config
1616
1717 t .Run ("ok" , func (t * testing.T ) {
18- assert .NilError (t , BeforeCommandExecutionHook ([] SourceFunc [ config ]{
18+ assert .NilError (t , BeforeCommandExecutionHook (& cfg ,
1919 func (_ context.Context , cfg * config ) error {
2020 cfg .A += "1"
2121 return nil
@@ -28,16 +28,18 @@ func Test_BeforeCommandExecutionHook(t *testing.T) {
2828 cfg .A += "3"
2929 return nil
3030 },
31- }, & cfg )(context .Background ()))
31+ )(context .Background ()))
3232
3333 assert .Check (t , cfg .A == "123" )
3434 })
3535
3636 t .Run ("error" , func (t * testing.T ) {
3737 expectedErr := errors .New ("boom" )
3838
39- assert .ErrorIs (t , BeforeCommandExecutionHook ([]SourceFunc [config ]{
40- func (context.Context , * config ) error { return expectedErr },
41- }, & cfg )(context .Background ()), expectedErr )
39+ assert .ErrorIs (t , BeforeCommandExecutionHook (& cfg ,
40+ func (context.Context , * config ) error {
41+ return expectedErr
42+ },
43+ )(context .Background ()), expectedErr )
4244 })
4345}
0 commit comments