go/src/context/x_test.go

// Each XTestFoo in context_test.go must be called from a TestFoo here to run.
func TestParentFinishesChild(t *testing.T) {}

func TestChildFinishesFirst(t *testing.T) {}

func TestCancelRemoves(t *testing.T) {}

func TestCustomContextGoroutines(t *testing.T) {}

type otherContext

const shortDuration

const veryLongDuration

// quiescent returns an arbitrary duration by which the program should have
// completed any remaining work and reached a steady (idle) state.
func quiescent(t *testing.T) time.Duration {}

func TestBackground(t *testing.T) {}

func TestTODO(t *testing.T) {}

func TestWithCancel(t *testing.T) {}

func testDeadline(c Context, name string, t *testing.T) {}

func TestDeadline(t *testing.T) {}

func TestTimeout(t *testing.T) {}

func TestCanceledTimeout(t *testing.T) {}

type key1

type key2

func (k key2) String() string {}

var k1

var k2

var k3

func TestValues(t *testing.T) {}

func TestAllocs(t *testing.T) {}

func TestSimultaneousCancels(t *testing.T) {}

func TestInterlockedCancels(t *testing.T) {}

func TestLayersCancel(t *testing.T) {}

func TestLayersTimeout(t *testing.T) {}

func testLayers(t *testing.T, seed int64, testTimeout bool) {}

func TestWithCancelCanceledParent(t *testing.T) {}

func TestWithCancelSimultaneouslyCanceledParent(t *testing.T) {}

func TestWithValueChecksKey(t *testing.T) {}

func TestInvalidDerivedFail(t *testing.T) {}

func recoveredValue(fn func()) (v any) {}

func TestDeadlineExceededSupportsTimeout(t *testing.T) {}

func TestCause(t *testing.T) {}

func TestCauseRace(t *testing.T) {}

func TestWithoutCancel(t *testing.T) {}

type customDoneContext

func (c *customDoneContext) Done() <-chan struct{}

func TestCustomContextPropagation(t *testing.T) {}

type customCauseContext

func (ccc *customCauseContext) Deadline() (deadline time.Time, ok bool) {}

func (ccc *customCauseContext) Done() <-chan struct{}

func (ccc *customCauseContext) Err() error {}

func (ccc *customCauseContext) Value(key any) any {}

func (ccc *customCauseContext) cancel() {}

func (ccc *customCauseContext) setCancelChild(cancelChild CancelFunc) {}

func TestCustomContextCause(t *testing.T) {}

func TestAfterFuncCalledAfterCancel(t *testing.T) {}

func TestAfterFuncCalledAfterTimeout(t *testing.T) {}

func TestAfterFuncCalledImmediately(t *testing.T) {}

func TestAfterFuncNotCalledAfterStop(t *testing.T) {}

// This test verifies that canceling a context does not block waiting for AfterFuncs to finish.
func TestAfterFuncCalledAsynchronously(t *testing.T) {}