{"id":19670269,"url":"https://github.com/jotaen/scmunit","last_synced_at":"2026-03-19T11:02:31.265Z","repository":{"id":74086580,"uuid":"257301644","full_name":"jotaen/scmunit","owner":"jotaen","description":"Lightweight unit testing and assertion library for MIT Scheme.","archived":false,"fork":false,"pushed_at":"2020-05-14T18:29:02.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T03:02:09.715Z","etag":null,"topics":["lisp","mit-scheme","scheme","scheme-language","testing"],"latest_commit_sha":null,"homepage":"","language":"Scheme","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/jotaen.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-04-20T14:11:31.000Z","updated_at":"2023-02-18T12:00:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"758e69b3-82d9-411c-811d-8acdddc4829e","html_url":"https://github.com/jotaen/scmunit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jotaen/scmunit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaen%2Fscmunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaen%2Fscmunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaen%2Fscmunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaen%2Fscmunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jotaen","download_url":"https://codeload.github.com/jotaen/scmunit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotaen%2Fscmunit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29723574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"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":["lisp","mit-scheme","scheme","scheme-language","testing"],"created_at":"2024-11-11T17:05:36.505Z","updated_at":"2026-02-22T19:04:45.233Z","avatar_url":"https://github.com/jotaen.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scmunit – Unit testing for Scheme with ease\n\n*scmunit* is a simple and lightweight test runner plus assertion library written in and for MIT Scheme (R7RS). *scmunit* comes with the following features:\n\n- 🚀 Small footprint (100 lines of code, 4 kB)\n- 🐣 Dead simple API (4 functions – that’s all there is)\n- 📝 Concise yet helpful report\n- ⏱ Runtime measurements\n\n\n## Example\n\n```scheme\n(load \"scmunit.scm\")\n\n(define (increment x) (+ x 1))\n\n(testcase* \"increments numbers by 1\" (list\n    (assert eq? (increment 0) 1)\n    (assert eq? (increment 12) 13)\n))\n\n(scmunit-run*)\n```\n\nAlso, see another demonstration in [test/example.scm](example.scm).\n\n\n## Reference\n\n### `(assert predicate expression [arguments])`\n\nEvaluates an expression against a predicate. The assertion is considered to be successful if the predicate returns true (`#t`).\n\n- `predicate` A predicate that takes the result of `expression` as first argument and `arguments` as subsequent arguments\n- `expression` The expression that you want to test\n- `arguments` See `predicate`\n\n### `(testcase name [items])`\n\nContainer for grouping assertions and/or other testcases. Can be nested arbitrarily deep.\n\n- `name` a string for recognising the testcase in the test output of the runner\n- `items` a list of assertions and/or testcases\n\n### `(testcase* ...)`\n\nSame as `(testcase ...)`, but it automatically registers the testcases with all its content, so that it gets picked up by the test runner. Supposed to be used at top-level.\n\n### `(scmunit-run*)`\n\nRuns all testcases that had been registered via `(testcase* ...)`, displays the result and exits the program with status `0` or `1` (depending on whether there were failed tests or not).\n\n\n## FAQ\n\n### How can I declare local variables or functions in a testcase?\n\nProvide the list of test items by means of a `let` block:\n\n```scheme\n(testcase \"magic computation\" (let ((MAGIC 42))\n    (define (square x) (* x x))\n    (list\n        (assert eq? (square MAGIC) 1764)\n)))\n```\n\n### Can test testcases be nested?\n\nYes, arbitrarily deep:\n\n```scheme\n(testcase \"foo\" (list\n    (testcase \"bar\" (list\n        (testcase \"baz\" (list\n            ; ...\n        ))\n    ))\n))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotaen%2Fscmunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjotaen%2Fscmunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotaen%2Fscmunit/lists"}