Skip to content

posener/contexttest

Repository files navigation

contexttest

Build Status codecov golangci GoDoc goreadme

Package contexttest is a collection of tests for context implementations.

The standard library, alongside a context interface, provides context implementation which gives the context implementation a behavior, such as a perceived immutability of the context object, safe concurrent access and cancel propagation.

This package gathers testing functions for context implementations in order to make sure that they follow the standard library behavior.

Usage

See example in ./standardlib_test.go.

Functions

func TestWithCancel(wc WithCancel) func(t *testing.T)

TestWithCancel tests the behavior of a context.WithCancel function.

func TestWithDeadline(withDeadline WithDeadline) func(t *testing.T)

TestWithDeadline tests the behavior of a context.WithDeadline function.

func TestWithTimeout(withTimeout WithTimeout) func(t *testing.T)

TestWithTimeout tests the behavior of a context.WithTimeout function.

func TestWithValue(wv WithValue) func(t *testing.T)

TestWithValue tests the behavior of a context.WithValue function.


Created by goreadme

About

Test package for context implementations

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages