Skip to content

More details needed about writing tests #28

@MichaelChirico

Description

@MichaelChirico

As someone who has (1) written / contributed to dozens of R packages and (2) written 10s of patches to R itself, I am still pretty unclear the "right" way to write tests for R patches.

It would be useful to have this spelled out in more detail in the guide, for example:

  • The tests/ folder uses the .R/.Rout system of snapshot tests that will be unfamiliar to many accustomed to other testing frameworks (e.g. testthat, which only recently embraced the usage of snapshot tests & anyway uses a different system for them)
  • Spell out when tests should be added to the top-level tests/ folder as opposed to the default package-level /tests/ folders (e.g. src/library/utils/tests)
  • The organization of the tests/ directory
  • How to decide in which file to write new tests for a given patch

Metadata

Metadata

Assignees

Labels

gsod-2022Google Season of Docs related task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions