@@ -5,12 +5,12 @@ import (
5
5
"testing"
6
6
)
7
7
8
- // TryRecvCtx will attempt to receive a value from the chan and return it. If
8
+ // TryReceive will attempt to receive a value from the chan and return it. If
9
9
// the context expires before a value can be received, it will fail the test. If
10
10
// the channel is closed, the zero value of the channel type will be returned.
11
11
//
12
12
// Safety: Must only be called from the Go routine that created `t`.
13
- func TryRecvCtx [A any ](ctx context.Context , t testing.TB , c <- chan A ) A {
13
+ func TryReceive [A any ](ctx context.Context , t testing.TB , c <- chan A ) A {
14
14
t .Helper ()
15
15
select {
16
16
case <- ctx .Done ():
@@ -22,12 +22,12 @@ func TryRecvCtx[A any](ctx context.Context, t testing.TB, c <-chan A) A {
22
22
}
23
23
}
24
24
25
- // RequireRecvCtx will receive a value from the chan and return it. If the
25
+ // RequireReceive will receive a value from the chan and return it. If the
26
26
// context expires or the channel is closed before a value can be received,
27
27
// it will fail the test.
28
28
//
29
29
// Safety: Must only be called from the Go routine that created `t`.
30
- func RequireRecvCtx [A any ](ctx context.Context , t testing.TB , c <- chan A ) A {
30
+ func RequireReceive [A any ](ctx context.Context , t testing.TB , c <- chan A ) A {
31
31
t .Helper ()
32
32
select {
33
33
case <- ctx .Done ():
@@ -42,11 +42,11 @@ func RequireRecvCtx[A any](ctx context.Context, t testing.TB, c <-chan A) A {
42
42
}
43
43
}
44
44
45
- // RequireSendCtx will send the given value over the chan and then return. If
45
+ // RequireSend will send the given value over the chan and then return. If
46
46
// the context expires before the send succeeds, it will fail the test.
47
47
//
48
48
// Safety: Must only be called from the Go routine that created `t`.
49
- func RequireSendCtx [A any ](ctx context.Context , t testing.TB , c chan <- A , a A ) {
49
+ func RequireSend [A any ](ctx context.Context , t testing.TB , c chan <- A , a A ) {
50
50
t .Helper ()
51
51
select {
52
52
case <- ctx .Done ():
0 commit comments