{"id":19167021,"url":"https://github.com/powerman/check","last_synced_at":"2025-05-07T13:41:22.334Z","repository":{"id":27707559,"uuid":"114983584","full_name":"powerman/check","owner":"powerman","description":"Helpers to complement Go testing package","archived":false,"fork":false,"pushed_at":"2025-01-15T16:02:39.000Z","size":306,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T03:58:05.796Z","etag":null,"topics":["go","golang","golang-library","unit-testing"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/powerman/check","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/powerman.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":"2017-12-21T08:46:03.000Z","updated_at":"2024-10-25T10:48:25.000Z","dependencies_parsed_at":"2024-06-19T02:48:42.368Z","dependency_job_id":"3f1109f9-dd13-457d-be78-65bba36e1b93","html_url":"https://github.com/powerman/check","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerman%2Fcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/powerman","download_url":"https://codeload.github.com/powerman/check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252889083,"owners_count":21820113,"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":["go","golang","golang-library","unit-testing"],"created_at":"2024-11-09T09:35:24.895Z","updated_at":"2025-05-07T13:41:22.299Z","avatar_url":"https://github.com/powerman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# check\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/powerman/check.svg)](https://pkg.go.dev/github.com/powerman/check)\n[![CI/CD](https://github.com/powerman/check/actions/workflows/CI\u0026CD.yml/badge.svg)](https://github.com/powerman/check/actions/workflows/CI\u0026CD.yml)\n[![Coverage Status](https://coveralls.io/repos/github/powerman/check/badge.svg?branch=master)](https://coveralls.io/github/powerman/check?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/powerman/check)](https://goreportcard.com/report/github.com/powerman/check)\n[![Release](https://img.shields.io/github/v/release/powerman/check)](https://github.com/powerman/check/releases/latest)\n\nHelpers to complement Go [testing](https://golang.org/pkg/testing/)\npackage.\n\nWrite tests with ease and fun!\n\nThis package is like\n[testify/assert](https://godoc.org/github.com/test-go/testify/assert)\non steroids. :)\n\n## Features\n\n- Compelling output from failed tests:\n  - Very easy-to-read dumps for expected and actual values.\n  - Same text diff you loved in testify/assert.\n  - Also visual diff in [GoConvey](http://goconvey.co/) web UI, if you\n    use it (recommended).\n- Statistics with amount of passed/failed checks.\n- Colored output in terminal.\n- 100% compatible with testing package - check package just provide\n  convenient wrappers for `*testing.T` methods and doesn't introduce new\n  concepts like BDD, custom test suite or unusual execution flow.\n- All checks you may ever need! :)\n- Very easy to add your own check functions.\n- Concise, handy and consistent API, without dot-import!\n\n## Quickstart\n\nJust wrap each (including subtests) `*testing.T` using `check.T()` and write\ntests as usually with testing package. Call new methods provided by this\npackage to have more clean/concise test code and cool dump/diff.\n\n```go\nimport \"github.com/powerman/check\"\n\nfunc TestSomething(tt *testing.T) {\n    t := check.T(tt)\n    t.Equal(2, 2)\n    t.Log(\"You can use new t just like usual *testing.T\")\n    t.Run(\"Subtests/Parallel example\", func(tt *testing.T) {\n        t := check.T(tt)\n        t.Parallel()\n        t.NotEqual(2, 3, \"should not be 3!\")\n        obj, err := NewObj()\n        if t.Nil(err) {\n            t.Match(obj.field, `^\\d+$`)\n        }\n    })\n}\n```\n\nTo get optional statistics about executed checkers add:\n\n```go\nfunc TestMain(m *testing.M) { check.TestMain(m) }\n```\n\nWhen use goconvey tool, to get nice diff in web UI\n[add](https://github.com/smartystreets/goconvey/issues/513):\n\n```go\nimport _ \"github.com/smartystreets/goconvey/convey\"\n```\n\n## Installation\n\nRequire [Go 1.9](https://golang.org/doc/go1.9#test-helper).\n\n```sh\ngo get github.com/powerman/check\n```\n\n## TODO\n\n- Doc:\n  - [ ] Add testable examples.\n  - [ ] Show how text diff and stats looks like (both text and screenshot with colors).\n  - [ ] Show how `goconvey` diff looks like.\n- Questionable:\n  - [ ] Support custom checkers from gocheck etc.?\n  - [ ] Provide a way to force binary dump for utf8.Valid `string`/`[]byte`?\n  - [ ] Count skipped tests (will have to overload `Skip`, `Skipf`, `SkipNow`)?\n- Complicated:\n  - [ ] Show line of source_test.go with failed test (like gocheck).\n  - [ ] Auto-detect missed `t:=check.T(tt)` - try to intercept `Run()` and\n        `Parallel()` for detecting using wrong `t` (looks like golangci-lint's\n        tparallel catch at least `Parallel()` case).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerman%2Fcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerman%2Fcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerman%2Fcheck/lists"}