{"id":17994947,"url":"https://github.com/totalkrill/every_variant","last_synced_at":"2025-03-26T02:31:14.385Z","repository":{"id":42992853,"uuid":"288474666","full_name":"TotalKrill/every_variant","owner":"TotalKrill","description":"Macro and trait to provide all variants in a vector for easy comprehensive unit testing","archived":false,"fork":false,"pushed_at":"2023-11-28T15:42:16.000Z","size":49,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T01:41:37.386Z","etag":null,"topics":["rust","test","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TotalKrill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-08-18T14:12:48.000Z","updated_at":"2022-08-29T15:27:11.000Z","dependencies_parsed_at":"2024-10-29T20:31:08.453Z","dependency_job_id":null,"html_url":"https://github.com/TotalKrill/every_variant","commit_stats":{"total_commits":72,"total_committers":3,"mean_commits":24.0,"dds":"0.23611111111111116","last_synced_commit":"b1e735d0493d2b547a1856cd31c76ffda7b22689"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fevery_variant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fevery_variant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fevery_variant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TotalKrill%2Fevery_variant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TotalKrill","download_url":"https://codeload.github.com/TotalKrill/every_variant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245576528,"owners_count":20638125,"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":["rust","test","testing","tools"],"created_at":"2024-10-29T20:17:16.990Z","updated_at":"2025-03-26T02:31:14.082Z","avatar_url":"https://github.com/TotalKrill.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# every_variant\n\nProvides an EveryVariant trait that provides the every_variant() method on\ntypes. Allows you to easily generate every combination of variants in\nstructures that contains Enums, or in nested enum trees. This to allow for\nadditional testing of codepaths where nested enum trees are used.\n\nThe derive macro EveryVariant will provide the every_variant() method for you,\nwith some preset values for the std types such as floats, integers and strings,\n\nThe generated data inside at the lowest level is currently fixed to specific\nvalues. If you have types that are dependend on strings with a specific format\non the strings for example, I suggest that those be made into their own types and every_variant implemented manually for those.\n\n\n## Example:\n\n``` rust\n\nuse every_variant::EveryVariant;\n\n/// Type of the message\n#[derive(EveryVariant, Debug, Clone)]\nenum MessageType {\n    Codified,\n    Markdown,\n    Html,\n}\n\n/// This type should generate 4 different variant\n#[derive(EveryVariant, Debug, Clone)]\nstruct FormattedMessage {\n    /// Enum dictating how to render the string, None means its hidden\n    rendermethod: Option\u003cMessageType\u003e,\n    /// The optional content of the message\n    text: String,\n}\n\nfn main() {\n    let all_diferent_messages = FormattedMessage::every_variant();\n    println!(\"{:#?}\", all_diferent_messages);\n}\n\n\n```\n\nthe output will be:\n\n```\n[\n    FormattedMessage {\n        rendermethod: None,\n        text: \"example String\",\n    },\n    FormattedMessage {\n        rendermethod: Some(\n            Codified,\n        ),\n        text: \"example String\",\n    },\n    FormattedMessage {\n        rendermethod: Some(\n            Markdown,\n        ),\n        text: \"example String\",\n    },\n    FormattedMessage {\n        rendermethod: Some(\n            Html,\n        ),\n        text: \"example String\",\n    },\n]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotalkrill%2Fevery_variant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotalkrill%2Fevery_variant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotalkrill%2Fevery_variant/lists"}