1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-09-28 21:29:25 +00:00

gateway: Removed unused test functions

This commit is contained in:
diamondburned 2022-10-03 04:35:27 -07:00
parent 3ae45b7816
commit afeacebced
No known key found for this signature in database
GPG key ID: D78C4471CE776659

View file

@ -169,33 +169,3 @@ func gatewayOpenAndSpin(t *testing.T, ctx context.Context, g *Gateway) {
} }
} }
} }
func wait(t *testing.T, evCh chan interface{}) interface{} {
select {
case ev := <-evCh:
return ev
case <-time.After(20 * time.Second):
t.Fatal("timed out waiting for event")
return nil
}
}
func gotimeout(t *testing.T, fn func(context.Context)) {
t.Helper()
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
var done = make(chan struct{})
go func() {
fn(ctx)
done <- struct{}{}
}()
select {
case <-ctx.Done():
t.Fatal("timed out waiting for function.")
case <-done:
return
}
}