{"id":36731068,"url":"https://github.com/adzil/eqtest","last_synced_at":"2026-01-12T12:12:24.576Z","repository":{"id":247005941,"uuid":"822442575","full_name":"adzil/eqtest","owner":"adzil","description":"Equality test assertions API using go-cmp","archived":false,"fork":false,"pushed_at":"2024-07-06T02:59:20.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T22:36:40.214Z","etag":null,"topics":["assertions","go","go-cmp","testing"],"latest_commit_sha":null,"homepage":"","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/adzil.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":"2024-07-01T06:58:20.000Z","updated_at":"2024-07-06T02:55:35.000Z","dependencies_parsed_at":"2024-07-06T04:48:12.309Z","dependency_job_id":"c4c6201b-4997-4d86-b4f5-2d29330a5807","html_url":"https://github.com/adzil/eqtest","commit_stats":null,"previous_names":["adzil/eqtest"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/adzil/eqtest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzil%2Feqtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzil%2Feqtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzil%2Feqtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzil%2Feqtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adzil","download_url":"https://codeload.github.com/adzil/eqtest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzil%2Feqtest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["assertions","go","go-cmp","testing"],"created_at":"2026-01-12T12:12:21.008Z","updated_at":"2026-01-12T12:12:24.570Z","avatar_url":"https://github.com/adzil.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eqtest - Equality test assertions with go-cmp\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/adzil/eqtest.svg)](https://pkg.go.dev/github.com/adzil/eqtest)\n[![codecov](https://codecov.io/github/adzil/eqtest/graph/badge.svg?token=O54SMZGI1T)](https://codecov.io/github/adzil/eqtest)\n\nEqtest provides equality test assertions API using go-cmp. It is not designed to compete or replace existing assertion frameworks such as testify, but rather to complement where it lacks such as proper equality comparison for complex types.\n\n## Quick Start\n\nTo start using `eqtest`, simply call `eqtest.New` from your Go test files:\n\n```go\npackage mypkg_test\n\nimport (\n    \"testing\"\n\n    \"github.com/adzil/eqtest\"\n)\n\nfunc TestSomething_Simple(t *testing.T) {\n    eqtest.Equal(t, \"hello\", \"world\") // This should fail the test.\n}\n\nfunc TestSomething_WithNew(t *testing.T) {\n    eqt := eqtest.New(t)\n\n    eqt.Equal(\"hello\", \"world\") // This should fail the test.\n}\n```\n\n## Using `cmp.Option`\n\nThere are three ways to add `cmp.Option` during the assertion:\n\n### 1. During `New` initialization\n\nThis will be useful if all of the assertions require the options such as transformers.\n\n```go\neqtest.New(t, cmp.Transformer(...))\n```\n\n### 2. Chain the option using `With`\n\nThis will be useful if there are subset of the assertions that need to have the same options such as filters.\n\n```go\neqt := eqtest.New(t).With(cmpopts.IgnoreFields(MyStruct{}, \"FieldOne\"))\n\neqt.Equal(...)\neqt.Equal(...)\n```\n\n### 3. During the call to `Equal` or `MustEqual`\n\nThis will be useful if an assertion needs a specific filter that doesn't needed by the others.\n\n```go\neqtest.New(t).Equal(expected, actual,\n    cmpopts.IgnoreFields(MyStruct{}, \"FieldTwo\"),\n)\n```\n\n## Reusing `cmp.Option`s from existing `Assertion`\n\nIf there are subtests that sharing the same `cmp.Option` as the current test, the existing `Assertion` can be cloned easily using a different `*testing.T` by calling `Assertion.Using`:\n\n```go\nfunc TestSomething(t *testing.T) {\n    eqt := eqtest.New(t,\n        cmpopts.SomeOption(...),\n        cmpopts.SomeOption(...),\n    )\n\n    t.Run(\"subtest with identical cmp options\", func(t *testing.T) {\n        eqt := eqt.With(t)\n\n        // Now the eqt will refer to the subtest t instead of the parent t.\n        eqt.Equal(...)\n    })\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzil%2Feqtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadzil%2Feqtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzil%2Feqtest/lists"}