{"id":15422551,"url":"https://github.com/heaths/samples-rs","last_synced_at":"2026-01-03T11:54:42.204Z","repository":{"id":250062890,"uuid":"833362822","full_name":"heaths/samples-rs","owner":"heaths","description":"Demonstration of tests and examples in Rust","archived":false,"fork":false,"pushed_at":"2024-07-27T07:00:03.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T05:34:58.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://heaths.dev/samples-rs/","language":"Rust","has_issues":false,"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/heaths.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}},"created_at":"2024-07-24T22:31:54.000Z","updated_at":"2024-07-27T07:00:05.000Z","dependencies_parsed_at":"2024-10-20T04:28:23.883Z","dependency_job_id":null,"html_url":"https://github.com/heaths/samples-rs","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":"0.33333333333333337","last_synced_commit":"8a822739c281c025755ca2fbff00b0373d472e65"},"previous_names":["heaths/samples-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fsamples-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fsamples-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fsamples-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heaths%2Fsamples-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heaths","download_url":"https://codeload.github.com/heaths/samples-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243934429,"owners_count":20371188,"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":[],"created_at":"2024-10-01T17:38:54.887Z","updated_at":"2026-01-03T11:54:42.177Z","avatar_url":"https://github.com/heaths.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Samples\n\nThis [repository](https://github.com/heaths/samples-rs) contains samples of unit tests, integration tests, and examples.\n\n![Samplesaurus](https://heaths.github.io/samples-rs/assets/samplesaurus_240.png)\n\n## Code sample\n\nAn example of code in a separate markdown document:\n\n```rust\nuse samples::say_hello;\n\nlet greeting = say_hello(\"world\");\nassert_eq!(\"hello, world!\", \u0026greeting);\n```\n\n## Documentation\n\nYou can also test samples in [separate documentation](https://github.com/heaths/samples-rs/blob/main/docs/index.md) in much the same way.\nBy injecting a single markdown file per module, line numbers will accurately reference lines of code in the injected markdown file.\n\nYou can exclude these modules from release code by attributing them as `#[cfg(doctest)]`.\n\nNote currently that you cannot declare types in code to reference in documentation tests with this predicate. See [rust-lang/rust#67295](https://github.com/rust-lang/rust/issues/67295) for more information and status.\n\n## Testing\n\nTo run all unit, integration, and doc tests:\n\n```bash\ncargo test\n```\n\nTo run any tests in examples:\n\n```bash\ncargo test --examples\n```\n\nTo run an example:\n\n```bash\ncargo run --example hello\ncargo run --example hello -- world\n```\n\n## More information\n\n* [Package layout](https://doc.rust-lang.org/cargo/guide/project-layout.html)\n* [`cargo test` command](https://doc.rust-lang.org/cargo/commands/cargo-test.html)\n* [`rustdoc` book](https://doc.rust-lang.org/rustdoc/)\n* [`rustdoc` documentation tests](https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheaths%2Fsamples-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheaths%2Fsamples-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheaths%2Fsamples-rs/lists"}