{"id":21909294,"url":"https://github.com/samwson/pascal-test","last_synced_at":"2026-03-19T21:22:39.053Z","repository":{"id":157881124,"uuid":"467798289","full_name":"samWson/pascal-test","owner":"samWson","description":"An Object Pascal unit test library.","archived":false,"fork":false,"pushed_at":"2022-06-05T08:28:54.000Z","size":38,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"trunk","last_synced_at":"2025-09-21T01:35:23.625Z","etag":null,"topics":["object-pascal","pascal","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samWson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-09T06:03:38.000Z","updated_at":"2022-05-30T08:33:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"ccf42214-e785-4479-afb7-38bda3aae095","html_url":"https://github.com/samWson/pascal-test","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/samWson/pascal-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samWson%2Fpascal-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samWson%2Fpascal-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samWson%2Fpascal-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samWson%2Fpascal-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samWson","download_url":"https://codeload.github.com/samWson/pascal-test/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samWson%2Fpascal-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["object-pascal","pascal","unit-testing"],"created_at":"2024-11-28T17:16:42.543Z","updated_at":"2026-02-14T18:32:03.077Z","avatar_url":"https://github.com/samWson.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pascal Test\n\nA unit testing framework for the Object Pascal programming language.\n\n## Usage\n\nPascal Test is not feature complete or fully automated. It features only basic \nassertions and requires manual setup by the developer. I will be using it for my\nown Pascal projects which will drive future development.\n\n'Unit', 'test', and 'unit-test' are words that get used a lot in this repository\nand can have different meaning. For clarity 'unit' refers to the Pascal unit (a\nmodule of code) and 'unit-test' (always hiphenated) refers to a function that\ntests a discrete unit of code.\n\n`PascalTest.pas` is the test source. It contains:\n- `assert()` for booleans\n- `assertEqual()` for integers and strings\n- `assertInDelta()` for floating point (real) numbers\n\nAssuming you have unit of code that requires testing e.g. `Lib.pas` your tests\nwill be placed in another unit e.g. `LibTest.pas`. Add the `Lib` and `PascalTest`\nunits to the `uses` clause. Write procedures using assertions, prefixing the\nprocedure names with `test`. Write another procedure called `run()` that calls\neach unit-test in the unit:\n\n```pascal\nunit LibTest;\n\ninterface\n\n  uses Lib, PascalTest;\n...\nimplementation\n\n  procedure run();\n  begin\n    testReturnsTen(); \n    testAddTen();\n    testConcatStrings();\n    testReturnsOnePointZero();\n    firstTest();\n    secondTest();\n    thirdTest()\n  end;\n\n...\nend.\n```\n\nA Pascal program will run the entire suite of tests by calling `LibTest.run()`\ne.g. `TestRunner.pas`:\n\n```pascal\nprogram TestRunner;\n\nuses LibTest;\n\nbegin\n  Writeln('Begin TestRunner');\n  Writeln();\n\n  // Running all of the LibTest unit tests. If we were testing more than\n  // one unit then we would have to qualify with the unit name to avoid \n  // conflicts e.g. LibTest.run();\n  run();\n\n  Writeln();\n  Writeln('All assertions passed');\n  Writeln('End')\nend.\n```\nCompile the `TestRunner` program `fpc TestRunner.pas`, then run the program: \n`./TestRunner`.\n\nThe naming and file conventions described here are not enforced so you are free to\ncreate your own system.\n\n### Dependancies\n\nPascal test was built with the [Free Pascal](https://www.freepascal.org/) compiler version 3.2.2.\n\n## Reference\n\nThis repository uses the talk on making a [test framework from scratch by\nRyan Davis](https://www.youtube.com/watch?v=VPr5pmlAq20\u0026t=756s) and the related\nsource for [Microtest](https://github.com/zenspider/microtest) as the starting\npoint for a test framework for Object Pascal.\n\n## License\n\nThis is open source software under the terms of the 3-Clause BSD License\n(BSD-3-Clause). See the LICENSE file for detail.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamwson%2Fpascal-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamwson%2Fpascal-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamwson%2Fpascal-test/lists"}