{"id":34794921,"url":"https://github.com/simonhdickson/paramtest","last_synced_at":"2025-12-25T10:39:13.718Z","repository":{"id":301626459,"uuid":"1009868750","full_name":"simonhdickson/paramtest","owner":"simonhdickson","description":"Macro to provide parameter based testing in Rust","archived":false,"fork":false,"pushed_at":"2025-09-29T16:20:16.000Z","size":31,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T23:59:05.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/simonhdickson.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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,"zenodo":null}},"created_at":"2025-06-27T21:25:48.000Z","updated_at":"2025-07-15T21:37:24.000Z","dependencies_parsed_at":"2025-06-27T21:49:46.601Z","dependency_job_id":"20670d2a-110a-41f4-8372-daab6b2f994f","html_url":"https://github.com/simonhdickson/paramtest","commit_stats":null,"previous_names":["simonhdickson/paramtest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simonhdickson/paramtest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonhdickson%2Fparamtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonhdickson%2Fparamtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonhdickson%2Fparamtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonhdickson%2Fparamtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonhdickson","download_url":"https://codeload.github.com/simonhdickson/paramtest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonhdickson%2Fparamtest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28026984,"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-12-25T02:00:05.988Z","response_time":58,"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":[],"created_at":"2025-12-25T10:39:11.929Z","updated_at":"2025-12-25T10:39:13.710Z","avatar_url":"https://github.com/simonhdickson.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# paramtest\n\nWith `paramtest`, you can define multiple sets of input values for a single test function, and each set will be run as a separate test case.\n\n## Example\n\nHere's how you can use `paramtest` in your tests:\n\n```rust\nuse paramtest::paramtest;\n\n#[paramtest(\n    one=(1, 2),\n    two=(2, 3),\n    hundred=(100, 101),\n)]\nfn add_one(input: u64, output: u64) {\n    assert_eq!(output, input + 1)\n}\n```\n\nThis is effectively the same as writing the following:\n\n```rust\n#[test]\nfn add_one_one() {\n    add_on(1, 2);\n}\n\n#[test]\nfn add_one_two() {\n    add_on(2, 3);\n}\n\n#[test]\nfn add_one_hundred() {\n    add_on(100, 101);\n}\n\nfn add_one(input: u64, output: u64) {\n    assert_eq!(output, input + 1)\n}\n```\n\nEach `#[paramtest(...)]` attribute defines named test cases with their own arguments. The macro will generate a separate test for each case, making your tests concise and easy to maintain.\n\n## Tokio Support\n\nTokio support is disabled by default. If you want to enable it, you can add the `tokio` feature to your `Cargo.toml`:\n\n```toml\n[dependencies]\nparamtest = { version = \"0.1.2\", features = [\"tokio\"] }\ntokio = { version = \"1.45.1\", features = [\"macros\", \"rt\"] }\n```\n\nAnd use the `#[tokio_paramtest]` attribute for your test functions:\n\n```rust\n#[tokio_paramtest(\n    one=(1, 2),\n    two=(2, 3),\n    hundred=(100, 101),\n)]\nasync fn add_one(input: u64, output: u64) {\n    assert_eq!(output, input + 1)\n}\n```\n\n## Usage\n\n1. Add`paramtest` crate as a dependency in your `Cargo.toml`.\n2. Annotate your test functions with `#[paramtest(...)]` and provide named cases with argument tuples.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonhdickson%2Fparamtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonhdickson%2Fparamtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonhdickson%2Fparamtest/lists"}