From afeacebcedf43cbe049538e0c77e9dcd466b2620 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Mon, 3 Oct 2022 04:35:27 -0700 Subject: [PATCH] gateway: Removed unused test functions --- gateway/gateway_test.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/gateway/gateway_test.go b/gateway/gateway_test.go index c6690ed..c3a6c42 100644 --- a/gateway/gateway_test.go +++ b/gateway/gateway_test.go @@ -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 - } -}