{"id":21517586,"url":"https://github.com/tek/polysemy-test","last_synced_at":"2025-04-09T21:42:34.562Z","repository":{"id":56875032,"uuid":"291347133","full_name":"tek/polysemy-test","owner":"tek","description":"Utilities for testing Polysemy programs","archived":false,"fork":false,"pushed_at":"2024-05-22T01:35:48.000Z","size":175,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-22T21:54:45.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","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/tek.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-29T20:50:47.000Z","updated_at":"2024-05-27T22:16:05.013Z","dependencies_parsed_at":"2024-05-27T22:15:53.061Z","dependency_job_id":null,"html_url":"https://github.com/tek/polysemy-test","commit_stats":{"total_commits":100,"total_committers":2,"mean_commits":50.0,"dds":"0.31999999999999995","last_synced_commit":"ea415dc18dda52cc2586651560d702a900de9d57"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fpolysemy-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fpolysemy-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fpolysemy-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tek%2Fpolysemy-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tek","download_url":"https://codeload.github.com/tek/polysemy-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248118956,"owners_count":21050750,"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-11-24T00:43:06.393Z","updated_at":"2025-04-09T21:42:34.524Z","avatar_url":"https://github.com/tek.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThis package provides utilities for testing [Polysemy] programs:\n\n* An effect, `Test`, that gives access to temporary files and fixtures\n* An effect, `Hedgehog`, for lifted [Hedgehog] assertions\n\n# Example\n\n```haskell\nimport Path (relfile)\nimport Polysemy.Test\nimport Test.Tasty (defaultMain)\n\ntest_fixture :: UnitTest\ntest_fixture =\n  runTestAuto do\n    fixContent1 \u003c- fixtureLines fixRel\n    fixPath \u003c- Test.fixturePath fixRel\n    fixContent2 \u003c- Text.lines \u003c$\u003e embed (Text.readFile (toFilePath fixPath))\n    fixContent1 === fixContent2\n    fixContent1 === [\"file\", \"content\"]\n  where\n    fixRel =\n      [relfile|files/file1|]\n\nmain :: IO ()\nmain =\n  defaultMain (unitTest test_fixture)\n```\n\n# Fixtures\n\nAny file that is located below the subdirectory `fixtures` inside the test\ndirectory can be accessed using the constructors `Test.fixturePath`,\n`Test.fixture` and `Text.fixtureLines`.\n\nYou can override the path used to look for the `fixtures` directory by using\n`runTest` instead of `runTestAuto`.\nThe latter analyzes the call stack to determine the test directory.\n\n# Temp Files\n\nThe constructors `Test.tempDir`, `Test.tempFile`, `Test.tempFileContent` and\n`Test.tempFileLines` allow you to create and read files in the `temp` directory\nwithin the test directory.\n\n# Paths\n\nAll paths are of type `Path` from the package [path].\n\nYou can construct them using the quasiquoters `reldir`, `absdir` etc. or the\nfunctions `parseRelDir`, `parseAbsDir` etc.\n\n[Polysemy]: https://hackage.haskell.org/package/polysemy\n[Hedgehog]: https://hackage.haskell.org/package/hedgehog\n[path]: https://hackage.haskell.org/package/path\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftek%2Fpolysemy-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftek%2Fpolysemy-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftek%2Fpolysemy-test/lists"}