{"id":13672298,"url":"https://github.com/enokson/laboratory","last_synced_at":"2026-03-17T22:05:04.353Z","repository":{"id":57634764,"uuid":"295074365","full_name":"enokson/laboratory","owner":"enokson","description":"A simple, expressive unit test framework for Rust","archived":false,"fork":false,"pushed_at":"2021-04-27T05:08:31.000Z","size":888,"stargazers_count":49,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-14T03:34:36.460Z","etag":null,"topics":["testing","unit"],"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/enokson.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}},"created_at":"2020-09-13T04:00:16.000Z","updated_at":"2025-02-07T10:45:32.000Z","dependencies_parsed_at":"2022-09-26T20:20:43.800Z","dependency_job_id":null,"html_url":"https://github.com/enokson/laboratory","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/enokson/laboratory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enokson%2Flaboratory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enokson%2Flaboratory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enokson%2Flaboratory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enokson%2Flaboratory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enokson","download_url":"https://codeload.github.com/enokson/laboratory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enokson%2Flaboratory/sbom","scorecard":{"id":377695,"data":{"date":"2025-08-11","repo":{"name":"github.com/enokson/laboratory","commit":"33f7307970cda286fa3fb7917b423d774ae345e7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/rust.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rust.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/enokson/laboratory/rust.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: MIT License: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: RUSTSEC-2020-0159","Warn: Project is vulnerable to: RUSTSEC-2022-0013 / GHSA-m5pq-gvj9-9vr8","Warn: Project is vulnerable to: RUSTSEC-2020-0071 / GHSA-wcg3-cvx6-7396"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T14:39:37.018Z","repository_id":57634764,"created_at":"2025-08-18T14:39:37.019Z","updated_at":"2025-08-18T14:39:37.019Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: 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":["testing","unit"],"created_at":"2024-08-02T09:01:31.638Z","updated_at":"2026-03-17T22:05:04.334Z","avatar_url":"https://github.com/enokson.png","language":"Rust","readme":"# laboratory\nA simple, expressive unit test framework for Rust\n\n\n\n![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/enokson/laboratory/build/master?style=for-the-badge)\n![Crates.io](https://img.shields.io/crates/v/laboratory?style=for-the-badge)\n![Crates.io](https://img.shields.io/crates/l/laboratory?style=for-the-badge)\n\nCheckout the [documentation](https://enokson.github.io/laboratory/) and the extensive [examples](https://github.com/enokson/laboratory/tree/master/examples) over on github.\n\nLaboratory is a layer 2 test runner solution that sits on top of the Rust test runner to provide unparalleled features and ease of use.\n\n## Features\n* before_all, before_each, after_all, after_each [hooks](https://enokson.github.io/laboratory/hooks.html)  \n* [Different reporter options](https://enokson.github.io/laboratory/reporters.html): spec, minimal, json, json-pretty, rust, dot, tap, list\n* The use of [state](https://enokson.github.io/laboratory/state.html)\n* Reports test durations in: nanoseconds, microseconds, milliseconds and seconds  \n* The use of custom assertion libraries  \n* Exclude tests  \n* Nested test suites  \n* Test retry support  \n* \"should panic\" testing\n* Console highlighting\n* Dynamic testing\n* Highlights slow tests\n* No weird macros to try to figure out or debug!\n* Human readable code and test results\n\n## Installation\nIn Cargo.toml:\n```toml\n[dev-dependencies]\nlaboratory = \"2.0.0\"\n```\nThen in your test files\n```rust\n#[cfg(test)]\nmod tests {\n    use laboratory::{describe, describe_skip, it, it_skip, it_only, expect};\n}\n```\n\n## Getting Started\n### Testing a simple function\n```rust\n// from examples/simple.rs\nfn main() {\n    add_one(0);\n}\n\n// Here we have one function that does\n// one thing: Adds one to whatever number\n// we pass to it.\nfn add_one (n: u64) -\u003e u64 { n + 1 }\n\n#[cfg(test)]\nmod tests {\n\n    // lets pull our add_one function into scope\n    use super::*;\n\n    // now let's pull in our lab tools into scope\n    // to test our function\n    use laboratory::{describe, expect, LabResult, NullState};\n\n    // From Rust's perspective we will only define\n    // one test, but inside this test we can define\n    // however many tests we need.\n    #[test]\n    fn suite() -\u003e LabResult {\n\n        // let's describe what our add_one() function will do.\n        // The describe function takes a closure as its second\n        // argument. And that closure also takes an argument which\n        // we will call \"suite\". The argument is the suite's context\n        // and it allows for extensive customizations. The context struct\n        // comes with a method called it() and using this method we can\n        // define a test.\n        describe(\"add_one()\", |suite| {\n\n            // when describing what it should do, feel free to be\n            // as expressive as you would like.\n            suite.it(\"should return 1 when passed 0\", |_| {\n\n                // here we will use the default expect function\n                // that comes with laboratory.\n                // We expect the result of add_one(0) to equal 1\n                expect(add_one(0)).to_equal(1)\n\n            })\n\n            // just as a sanity check, let's add a second test\n            .it(\"should return 2 when passed 1\", |_| {\n\n                expect(add_one(1)).to_equal(2)\n\n            });\n\n        }).state(NullState).milis().run()\n\n    }\n}\n```\n\nThen run: \n```shell script\n$ cargo test -- --nocapture\n```\n\nResult:  \n```\n\nrunning 1 test\n\n\n### Lab Results Start ###\n\nadd_one()\n  ✓  should return 1 when passed 0 (0ms)\n  ✓  should return 2 when passed 1 (0ms)\n✓ 2 tests completed (0ms)\n\n### Lab Results End ###\n\n\ntest tests::suite ... ok\n\ntest result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s\n\n\n```\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenokson%2Flaboratory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenokson%2Flaboratory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenokson%2Flaboratory/lists"}