Source file src/net/http/internal/http2/synctest_test.go

     1  // Copyright 2025 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package http2_test
     6  
     7  import (
     8  	"testing"
     9  	"testing/synctest"
    10  )
    11  
    12  func synctestTest(t *testing.T, f func(t testing.TB)) {
    13  	t.Helper()
    14  	synctest.Test(t, func(t *testing.T) {
    15  		t.Helper()
    16  		f(t)
    17  	})
    18  }
    19  
    20  // synctestSubtest starts a subtest and runs f in a synctest bubble within it.
    21  func synctestSubtest(t *testing.T, name string, f func(testing.TB)) {
    22  	t.Helper()
    23  	t.Run(name, func(t *testing.T) {
    24  		synctestTest(t, f)
    25  	})
    26  }
    27  

View as plain text