{"id":19666250,"url":"https://github.com/dunnandusted/test_gen","last_synced_at":"2025-09-20T21:38:53.112Z","repository":{"id":62671137,"uuid":"540648721","full_name":"DunnAnDusted/test_gen","owner":"DunnAnDusted","description":"A comprehensive function-like macro, for concisely defining parameterised tests.","archived":false,"fork":false,"pushed_at":"2023-02-13T15:50:59.000Z","size":138,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T03:07:09.807Z","etag":null,"topics":["macros","parameterized","parameterized-tests","rust","rust-crate","rust-lang","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DunnAnDusted.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2022-09-23T23:28:00.000Z","updated_at":"2023-01-31T20:27:43.000Z","dependencies_parsed_at":"2024-11-11T16:39:12.778Z","dependency_job_id":null,"html_url":"https://github.com/DunnAnDusted/test_gen","commit_stats":{"total_commits":128,"total_committers":2,"mean_commits":64.0,"dds":0.2578125,"last_synced_commit":"495f39ecae7a116bdb510a55dfc58830ebdb9f2d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/DunnAnDusted/test_gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DunnAnDusted%2Ftest_gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DunnAnDusted%2Ftest_gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DunnAnDusted%2Ftest_gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DunnAnDusted%2Ftest_gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DunnAnDusted","download_url":"https://codeload.github.com/DunnAnDusted/test_gen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DunnAnDusted%2Ftest_gen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267945379,"owners_count":24170218,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["macros","parameterized","parameterized-tests","rust","rust-crate","rust-lang","testing-tools"],"created_at":"2024-11-11T16:26:53.105Z","updated_at":"2025-09-20T21:38:48.039Z","avatar_url":"https://github.com/DunnAnDusted.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# test_gen\nA comprehensive function-like macro, for concisely defining parameterized tests.\n\nThis crate provides the function-like macro of its namesake, `test_gen`,\nwhich enables the concise definition of batches of named tests,\nimplementing a parameterized argument format to minimise the boilerplate\notherwise required for specifying batches of similar tests.\n\nDocumentation can be found at [Docs.rs].\n\n[Docs.rs]: https://docs.rs/test_gen/latest/test_gen\n\n## Usage\n**Minimum Supported Rust Version:** 1.63.0\n\n`test_gen` can be added to a project, using the following command:\n```text\ncargo add test_gen --dev\n```\n\nOr alternatively, by adding the following lines to its `Cargo.toml` file:\n```toml\n[dev-dependancies]\ntest_gen = \"0.2.3\"\n```\n\n## Examples\n\nFruits:\n```rust\nuse test_gen::*;\n\nenum Fruit\u003cT\u003e {\n    Apple,\n    Pear,\n    Other(T),\n}\n\nenum BrambleFruit {\n    BlackBerry,\n}\n\ntrait NameOf {\n    fn name_of(\u0026self) -\u003e \u0026str;\n}\n\nimpl\u003cT: NameOf\u003e NameOf for Fruit\u003cT\u003e {\n    fn name_of(\u0026self) -\u003e \u0026str {\n        use Fruit::*;\n\n        match self {\n            Apple =\u003e \"apple\",\n            Pear =\u003e \"pear\",\n            Other(fruit) =\u003e fruit.name_of(),\n        }\n    }\n}\n\nimpl NameOf for BrambleFruit {\n    fn name_of(\u0026self) -\u003e \u0026str {\n        use BrambleFruit::*;\n\n        match self {\n            BlackBerry =\u003e \"blackberry\",\n        }\n    }\n}\n\n// Helper function\nfn assert_fruit\u003cT: NameOf\u003e(fruit: Fruit\u003cT\u003e, name: \u0026str) {\n    assert_eq!(fruit.name_of(), name);\n}\n\n// Test specification\ntest_gen! {\n    // Normal turbofish syntax can be used,\n    // when concrete type specification is required\n    fn assert_fruit::\u003cBrambleFruit\u003e =\u003e {\n        apple: {\n            (Fruit::Apple, \"apple\")\n        },\n        // Applying case specific attributes\n        pear: {\n            #[ignore]\n            (Fruit::Pear, \"pear\")\n        },\n        isnt_pear: {\n            #[should_panic]\n            (Fruit::Pear, \"apple\")\n        },\n        blackberry: {\n            (Fruit::Other(BrambleFruit::BlackBerry), \"blackberry\")\n        },\n    }\n}\n```\n\n## License\n\n`test_gen` is licensed under the BSD 3-Clause license.\n\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunnandusted%2Ftest_gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdunnandusted%2Ftest_gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunnandusted%2Ftest_gen/lists"}