@@ -191,7 +191,7 @@ func testClientConnReadFrame[T any](tc *testClientConn) T {
191
191
var v T
192
192
fr := tc .readFrame ()
193
193
if fr == nil {
194
- tc .t .Fatalf ("got no frame, want frame %v " , v )
194
+ tc .t .Fatalf ("got no frame, want frame %T " , v )
195
195
}
196
196
v , ok := fr .(T )
197
197
if ! ok {
@@ -203,6 +203,7 @@ func testClientConnReadFrame[T any](tc *testClientConn) T {
203
203
// wantFrameType reads the next frame from the conn.
204
204
// It produces an error if the frame type is not the expected value.
205
205
func (tc * testClientConn ) wantFrameType (want FrameType ) {
206
+ tc .t .Helper ()
206
207
fr := tc .readFrame ()
207
208
if fr == nil {
208
209
tc .t .Fatalf ("got no frame, want frame %v" , want )
@@ -221,11 +222,8 @@ type wantHeader struct {
221
222
// wantHeaders reads a HEADERS frame and potential CONTINUATION frames,
222
223
// and asserts that they contain the expected headers.
223
224
func (tc * testClientConn ) wantHeaders (want wantHeader ) {
224
- fr := tc .readFrame ()
225
- got , ok := fr .(* MetaHeadersFrame )
226
- if ! ok {
227
- tc .t .Fatalf ("got %v, want HEADERS frame" , want )
228
- }
225
+ tc .t .Helper ()
226
+ got := testClientConnReadFrame [* MetaHeadersFrame ](tc )
229
227
if got , want := got .StreamID , want .streamID ; got != want {
230
228
tc .t .Fatalf ("got stream ID %v, want %v" , got , want )
231
229
}
0 commit comments