@@ -191,7 +191,7 @@ func testClientConnReadFrame[T any](tc *testClientConn) T {
191191 var v T
192192 fr := tc .readFrame ()
193193 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 )
195195 }
196196 v , ok := fr .(T )
197197 if ! ok {
@@ -203,6 +203,7 @@ func testClientConnReadFrame[T any](tc *testClientConn) T {
203203// wantFrameType reads the next frame from the conn.
204204// It produces an error if the frame type is not the expected value.
205205func (tc * testClientConn ) wantFrameType (want FrameType ) {
206+ tc .t .Helper ()
206207 fr := tc .readFrame ()
207208 if fr == nil {
208209 tc .t .Fatalf ("got no frame, want frame %v" , want )
@@ -221,11 +222,8 @@ type wantHeader struct {
221222// wantHeaders reads a HEADERS frame and potential CONTINUATION frames,
222223// and asserts that they contain the expected headers.
223224func (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 )
229227 if got , want := got .StreamID , want .streamID ; got != want {
230228 tc .t .Fatalf ("got stream ID %v, want %v" , got , want )
231229 }
0 commit comments