{"id":34117597,"url":"https://github.com/ninedraft/huffy","last_synced_at":"2026-03-10T18:08:25.014Z","repository":{"id":57608402,"uuid":"194644323","full_name":"ninedraft/huffy","owner":"ninedraft","description":"Tiny package for smart testcase caching","archived":false,"fork":false,"pushed_at":"2019-07-13T13:26:56.000Z","size":43,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-17T05:28:09.895Z","etag":null,"topics":["fuzzing","go","golang","test-automation-project","test-generation","testing","unit-test"],"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/ninedraft.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}},"created_at":"2019-07-01T09:40:18.000Z","updated_at":"2025-08-27T13:32:06.000Z","dependencies_parsed_at":"2022-09-03T10:20:38.728Z","dependency_job_id":null,"html_url":"https://github.com/ninedraft/huffy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ninedraft/huffy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninedraft%2Fhuffy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninedraft%2Fhuffy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninedraft%2Fhuffy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninedraft%2Fhuffy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ninedraft","download_url":"https://codeload.github.com/ninedraft/huffy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninedraft%2Fhuffy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30346584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"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":["fuzzing","go","golang","test-automation-project","test-generation","testing","unit-test"],"created_at":"2025-12-14T20:35:09.388Z","updated_at":"2026-03-10T18:08:25.006Z","avatar_url":"https://github.com/ninedraft.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# huffy\n[![Go Report Card](https://goreportcard.com/badge/github.com/ninedraft/huffy)](https://goreportcard.com/report/github.com/ninedraft/huffy) [![GoDoc](https://godoc.org/github.com/ninedraft/huffy?status.svg)](https://godoc.org/github.com/ninedraft/huffy)\n\nHuffy is a small library for unit testing in symbiosis with test data generators. It allows you to remember the test arguments that caused the fail test. At the next test run, these arguments will be used first.\n\n## Example\n\n```go\n// calculate.go\n\npackage countchars\n\n// Div must return result of division, rounded to biggest value\nfunc Div(x, y int) int {\n\treturn x / y\n}\n\n```\n\n```go\n// calculate_test.go\npackage countchars\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n\n\t\"github.com/ninedraft/huffy\"\n)\n\nfunc TestDiv(test *testing.T) {\n\ttype TestCase struct {\n\t\tX, Y     int\n\t\tExpected int\n\t}\n\n\thuffy.Tester{\n\t\tGenerator: func(rnd *rand.Rand, id int) interface{} {\n\t\t\tvar x = rnd.Intn(100) + 2\n\t\t\tvar y = rnd.Intn(x-1) + 1\n\t\t\tvar expected = x / y\n\t\t\tif x%y != 0 {\n\t\t\t\texpected++\n\t\t\t}\n\t\t\treturn TestCase{\n\t\t\t\tX:        x,\n\t\t\t\tY:        y,\n\t\t\t\tExpected: expected,\n\t\t\t}\n\t\t},\n\t\tUnit: func(test *testing.T, v interface{}) {\n\t\t\tvar tc = v.(TestCase)\n\t\t\tvar got = Div(tc.X, tc.Y)\n\t\t\tif tc.Expected != got {\n\t\t\t\ttest.Fatalf(\"%d/%d: expected %d, got %d\", tc.X, tc.Y, tc.Expected, got)\n\t\t\t}\n\t\t},\n\t}.R(test)\n}\n```\n\n```bash\ngo test -timeout 30s github.com/ninedraft/huffy/examples/calculate -run ^(TestDiv)$ -race\n```\n\n```\n--- FAIL: TestDiv (0.00s)\n    huffy/examples/calculate/calculate_test.go:34: 44/25: expected 2, got 1\nFAIL\nFAIL\tgithub.com/ninedraft/huffy/examples/calculate\t0.041s\nError: Tests failed.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninedraft%2Fhuffy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninedraft%2Fhuffy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninedraft%2Fhuffy/lists"}