{"id":21432444,"url":"https://github.com/gagolews/realtest","last_synced_at":"2025-07-14T12:33:37.976Z","repository":{"id":151189691,"uuid":"371191133","full_name":"gagolews/realtest","owner":"gagolews","description":"When Expectations Meet Reality: Realistic Unit Testing in R ","archived":false,"fork":false,"pushed_at":"2024-07-11T10:22:41.000Z","size":14302,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-16T22:39:59.867Z","etag":null,"topics":["continuous-testing","r","testing-tools","unit-testing"],"latest_commit_sha":null,"homepage":"https://realtest.gagolewski.com","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gagolews.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-05-26T23:17:10.000Z","updated_at":"2024-08-25T10:54:27.000Z","dependencies_parsed_at":"2024-07-10T23:43:52.628Z","dependency_job_id":null,"html_url":"https://github.com/gagolews/realtest","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gagolews%2Frealtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gagolews%2Frealtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gagolews%2Frealtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gagolews%2Frealtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gagolews","download_url":"https://codeload.github.com/gagolews/realtest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225976738,"owners_count":17554269,"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":["continuous-testing","r","testing-tools","unit-testing"],"created_at":"2024-11-22T23:18:33.864Z","updated_at":"2024-11-22T23:18:34.443Z","avatar_url":"https://github.com/gagolews.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://realtest.gagolewski.com/\"\u003e\u003cimg src=\"https://www.gagolewski.com/_static/img/realtest.png\" align=\"right\" height=\"128\" width=\"128\" /\u003e\u003c/a\u003e\n# [**`realtest`**](https://realtest.gagolewski.com)\n\n### Where Expectations Meet Reality: Realistic Unit Testing in [R](https://www.r-project.org/)\n\n\u003e [**`realtest`**](https://realtest.gagolewski.com/) is a framework for unit testing\n\u003e for realistic minimalists; it aids in formalising:\n\u003e\n\u003e * assertions,\n\u003e * current behaviour that we'd like to see changed in the future,\n\u003e * alternative yet perfectly acceptable practices (e.g., when outputs\n\u003e   are platform-dependent and should remain so),\n\u003e * requested features to be implemented in due time\n\u003e   (e.g., as part of the monitoring of third-party\n\u003e   software projects for changes).\n\nThe introduced vocabulary is (and will be kept!) minimalistic:\n\n*  **`P`** is *prototype* – you can use it to manually create a descriptor like\n    \"*I expect this function to return `c(1, 2, 3)`, with a warning*\"\n    or \"*that should result in an error*\";\n\n*  **`R`** stands for *record* – creates a descriptor by evaluating an\n    expression and capturing its direct and indirect effects:\n\n    * values generated (together with object attributes),\n    * errors,\n    * warnings and messages,\n    * text output on `stdout` and `stderr`;\n\n*  **`E`** means *expect* – compares an expression under scrutiny (via `R`)\n    with a series of descriptors (created via `P` or `R` and using\n    a pairwise comparer provided) and stores the matching one (if any).\n\n--------------------------------------------------------------------------------\n\nSome examples:\n\n```r\nlibrary(\"realtest\")  # call install.packages(\"realtest\") first\n\n# identical\nE(sqrt(4), 2.0)  # equivalent to E(sqrt(4), P(2.0))\n\n# almost-equal (round-off errors)\nE(sin(pi), 0.0, value_comparer=all.equal)\n\n# two equally okay possible outcomes:\nE(sample(c(\"head\", \"tail\"), 1), \"head\", \"tail\")\n\n# not-a-number, with a warning\nE(sqrt(-1), P(NaN, warning=TRUE))\n\n# desired vs. current vs. undesired (because it can always be worse!) behaviour\nE(\n    paste0(1:2, 1:3),                  # expression to test - concatenation\n    best=P(                            # what we yearn for (ideally)\n        c(\"11\", \"22\", \"13\"),\n        warning=TRUE\n    ),\n    current=c(\"11\", \"22\", \"13\"),       # this is the behaviour we have now\n    bad=P(error=TRUE)                  # avoid regression\n    # and of course, everything else (un-expected) makes up a failed test\n)\n```\n\nRefer to the on-line documentation at \u003chttps://realtest.gagolewski.com/\u003e\nfor more details.\n\nTo learn more about R, check out Marek's open-access (free!) textbook\n[*Deep R Programming*](https://deepr.gagolewski.com/).\n\n\n\n--------------------------------------------------------------------------------\n\n**Package Maintainer and Author**:\n[Marek Gagolewski](https://www.gagolewski.com/)\n\n**Homepage**: \u003chttps://realtest.gagolewski.com/\u003e\n\n**CRAN Entry**: \u003chttps://CRAN.R-project.org/package=realtest\u003e\n\n**License**:\n**`realtest`** is distributed under the terms of the GNU General Public License,\neither Version 2 or Version 3, see\n[LICENSE](https://raw.githubusercontent.com/gagolews/realtest/master/LICENSE)\n\n**Changelog**: see\n[NEWS](https://raw.githubusercontent.com/gagolews/realtest/master/NEWS)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgagolews%2Frealtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgagolews%2Frealtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgagolews%2Frealtest/lists"}