{"id":15765533,"url":"https://github.com/posener/contexttest","last_synced_at":"2025-03-31T10:41:12.158Z","repository":{"id":84686906,"uuid":"194383979","full_name":"posener/contexttest","owner":"posener","description":"Test package for context implementations","archived":false,"fork":false,"pushed_at":"2019-06-29T09:17:33.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-05T12:42:18.855Z","etag":null,"topics":["context","go","golang","test","testing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posener.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-29T08:44:00.000Z","updated_at":"2019-06-29T17:30:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"daaf818f-1a0d-4e8f-8720-386e3ce9a2ab","html_url":"https://github.com/posener/contexttest","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posener%2Fcontexttest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posener%2Fcontexttest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posener%2Fcontexttest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posener%2Fcontexttest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posener","download_url":"https://codeload.github.com/posener/contexttest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246457974,"owners_count":20780673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["context","go","golang","test","testing"],"created_at":"2024-10-04T12:42:31.236Z","updated_at":"2025-03-31T10:41:12.129Z","avatar_url":"https://github.com/posener.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contexttest\n\n[![Build Status](https://travis-ci.org/posener/contexttest.svg?branch=master)](https://travis-ci.org/posener/contexttest)\n[![codecov](https://codecov.io/gh/posener/contexttest/branch/master/graph/badge.svg)](https://codecov.io/gh/posener/contexttest)\n[![golangci](https://golangci.com/badges/github.com/posener/contexttest.svg)](https://golangci.com/r/github.com/posener/contexttest)\n[![GoDoc](https://godoc.org/github.com/posener/contexttest?status.svg)](http://godoc.org/github.com/posener/contexttest)\n[![goreadme](https://goreadme.herokuapp.com/badge/posener/contexttest.svg)](https://goreadme.herokuapp.com)\n\nPackage contexttest is a collection of tests for context implementations.\n\nThe standard library, alongside a context interface, provides context implementation\nwhich gives the context implementation a behavior, such as a perceived immutability\nof the context object, safe concurrent access and cancel propagation.\n\nThis package gathers testing functions for context implementations\nin order to make sure that they follow the standard library behavior.\n\n#### Usage\n\nSee example in [./standardlib_test.go](./standardlib_test.go).\n\n## Functions\n\n### func [TestWithCancel](https://github.com/posener/contexttest/blob/master/cancel.go#L16)\n\n`func TestWithCancel(wc WithCancel) func(t *testing.T)`\n\nTestWithCancel tests the behavior of a context.WithCancel function.\n\n### func [TestWithDeadline](https://github.com/posener/contexttest/blob/master/deadline.go#L23)\n\n`func TestWithDeadline(withDeadline WithDeadline) func(t *testing.T)`\n\nTestWithDeadline tests the behavior of a context.WithDeadline function.\n\n### func [TestWithTimeout](https://github.com/posener/contexttest/blob/master/timeout.go#L13)\n\n`func TestWithTimeout(withTimeout WithTimeout) func(t *testing.T)`\n\nTestWithTimeout tests the behavior of a context.WithTimeout function.\n\n### func [TestWithValue](https://github.com/posener/contexttest/blob/master/value.go#L16)\n\n`func TestWithValue(wv WithValue) func(t *testing.T)`\n\nTestWithValue tests the behavior of a context.WithValue function.\n\n\n---\n\nCreated by [goreadme](https://github.com/apps/goreadme)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposener%2Fcontexttest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposener%2Fcontexttest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposener%2Fcontexttest/lists"}