Skip to content

decorate and retrieve @examples calls from testthat/ #12

@maxheld83

Description

@maxheld83

another (third?) alternative idea for the existing source_pef()-clumsiness, after #11 #4 have failed:

It'd be nice to have some magic markup/decoration inside the testthat that can then be called from roxygen decorators, like so (absolute pseudocode):

testthat/test-foo.R:

res <- {#' @exampleFromTestthat bar_1
  bar_fun(1, 2)
}
test_that("lorem", expect_true(res))

R/foo.R:

#' Foo function
#' @reuseExamplesFromTestthat bar_1
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions