{"id":16489583,"url":"https://github.com/alvinwan/uniexpect","last_synced_at":"2026-04-18T10:37:23.221Z","repository":{"id":62586375,"uuid":"46599022","full_name":"alvinwan/UniExpect","owner":"alvinwan","description":"doctest utility and inline testing for REPL languages","archived":false,"fork":false,"pushed_at":"2018-01-01T12:17:17.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-20T22:38:08.990Z","etag":null,"topics":["inline-testing","language","python","python-doctests","repl","scheme","sqlite","testing","utility"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alvinwan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-21T03:13:56.000Z","updated_at":"2023-07-06T18:20:47.000Z","dependencies_parsed_at":"2022-11-03T22:38:05.667Z","dependency_job_id":null,"html_url":"https://github.com/alvinwan/UniExpect","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alvinwan/UniExpect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2FUniExpect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2FUniExpect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2FUniExpect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2FUniExpect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvinwan","download_url":"https://codeload.github.com/alvinwan/UniExpect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinwan%2FUniExpect/sbom","scorecard":{"id":187701,"data":{"date":"2025-08-11","repo":{"name":"github.com/alvinwan/UniExpect","commit":"a426fbc9f636447430e3c3ab9a8d23ed60bb8be6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE: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"}}]},"last_synced_at":"2025-08-16T20:06:06.944Z","repository_id":62586375,"created_at":"2025-08-16T20:06:06.944Z","updated_at":"2025-08-16T20:06:06.944Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278406561,"owners_count":25981657,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["inline-testing","language","python","python-doctests","repl","scheme","sqlite","testing","utility"],"created_at":"2024-10-11T13:44:38.299Z","updated_at":"2025-10-05T03:58:03.957Z","avatar_url":"https://github.com/alvinwan.png","language":"Python","readme":"# UniExpect\nUniExpect (UE) offers inline testing for *any* REPL language, making the notion of \ndoctests more universal and even more versatile. There are two immediate\nbenefits to using the UE utility:\n\n1. With this, code in all supported languages can be placed directly below executable,\neasily-checked tests that help to explain a function or class's basic\nfunctionality.\n\n2. The \"unittest\" approach to testing antiquates manual, sandbox testing.\nWriting code in SQL could, for example, could benefit immensely. Each accidental\ntable modification means you have to restart the session, copy in the data, and\n*then* try your code again. With UE, it's just one command: `expect test.sql`.\n\nSee below for how to get started.\n\n## Installation\n\nUniExpect is now installable via pypi:\n\n```\npip install uniexpect\n```\n\n## How to Use\n\nThe standard expect syntax matches that of Python doctests. By default, the\ntest input prefix is `\u003e\u003e\u003e`. In other words, tests following the following\nformat.\n\n```\n\u003e\u003e\u003e \u003cinput\u003e\n\u003coutput\u003e\n```\n\nAny language with block comments, such as `/* ... */` or `\"\"\" ... \"\"\"`, can use\nthe following syntax:\n\n```\n/*\n\u003e\u003e\u003e \u003ctest input\u003e\n\u003cexpected output\u003e\n\u003e\u003e\u003e \u003ctest input\u003e\n\u003cexpected output\u003e\n*/\n```\n\nFor languages that only support inline comments, UE default configuration files\nuse the following convention to denote test suites:\n\n```\n###\n# \u003e\u003e\u003e \u003ctest input\u003e\n# \u003cexpected output\u003e\n# \u003e\u003e\u003e \u003ctest input\u003e\n# \u003cexpected output\u003e\n###\n```\n\nThe comment symbol is simply repeated three times before and after the test\nsuite. For more concrete examples, see the `samples/` folder.\n\n## How to Run\n\nUsage is simple. To run `expect` on `samples/scheme.scm`:\n\n```\nexpect samples/scheme.scm\n```\n\n## Settings\n\nThe following is an abridged list of more commonly-used settings. For a full\nlist, run `expect --help`.\n\n### `--language=\u003clanguage\u003e`\n\nIf the language is not specified, UE will (1) assume the file extension is\nthe language name and, if no such configuration file exists, will (2) search all\npreference files with the same first letter as the extension.\n\nExample: `expect samples/sql.sql --language=sql`\n\n### `--verbose`\n\nJust as Python doctests do, UniExpect only reports incorrect outputs by\ndefault. To view all output, pass the `verbose` flag. Add `v`s to increase\nverbosity, with `-vvv` for maximum whining.\n\nExamples:\n- `expect samples/python.py --verbose`\n- `expect samples/python.py -vvv`\n\n## Support\n\nUniExpect can be used for nearly any programming language. Here are a few that\nI've already setup configurations for:\n\n- python2.7\n```\nexpect samples/python.py --language=python2\n```\n\n- python3\n```\nexpect samples/python.py --language=python3\n```\n\n- scheme\n```\nexpect samples/scheme.scm\n```\nversion: chibi-scheme\n\n- sqlite3\n```\nexpect samples/sqlite.sql\n```\n\nUE has also been setup to work with custom programming languages.\n\n- berkeleyscheme\n```\nexpect samples/berkeleyscheme.scm --language=berkeleyscheme\n```\n\n## How to Add a Language\n\nTake the Scheme specification as an example. The first several sections\nare self-explanatory: we describe the shell basics, language information, \nand comment styles. As for the tests, each dictionary represents a\n different test type. The `input_prefix` and `output_prefix` denote the\n question and expected response, respectively. `block_comments` indicates\n whether or not we can expect this test type into a comment block. The\n `inline_comments` likewise indicates whether or not we can expect this\n test type in inline comments. See more examples in the \n [`samples/`](https://github.com/alvinwan/UniExpect/tree/master/samples) directory.\n\n```\nshell = {\n    'command': 'scheme',\n    'prompt': '\u003e ',\n    'continuation': '\u003e\u003e ',\n    '_load_file': '(load \"{filename}\")'\n}\n\nlanguage = 'scheme'\nextension = 'scm'\n\n# doesn't exist in scheme, but we will use ;;; to denote multi-line tests\nblock_comments = [(';;;', ';;;')]\n\ninline_comments = [';']\n\ntests = [\n    {\n        'input_prefix': '; \u003e\u003e\u003e',  # prefix for test input\n        'output_prefix': ';',  # prefix for test output\n        'block_comments': True,  # just like standard doctests\n        'inline_comments': False\n    },\n    {\n        'input_prefix': '\u003e ',\n        'output_prefix': '=\u003e',\n        'one-liner': True,\n        'block_comments': True,\n        'inline_comments': True\n    }\n]\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinwan%2Funiexpect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvinwan%2Funiexpect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinwan%2Funiexpect/lists"}