Skip to content

Commit

Permalink
Update biocroxytest.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
xec-cm committed Jan 17, 2024
1 parent ff72bc5 commit 46fc441
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vignettes/biocroxytest.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The `r BiocStyle::Githubpkg("xec-cm/biocroxytest")` package allows you to add ex

1. **Add the `@longtests` tag to your function documentation**: In your roxygen comments for each function, you can add a `@longtests` tag followed by the tests you want to run. These tests should be written as if they were in a `testthat::test_that()` call. For example:

```{r, eval = FALSE}
```{r}
#' A function to do x
#'
#' @param x A number
Expand All @@ -86,14 +86,14 @@ In this example, the function `foo()` has two long tests associated with it: `ex

For instance, if you have the `foo()` function in a file named `R/functions.R`, `roxygen2::roxygenise()` will generate a file named `longtests/test-biocroxytest-tests-functions.R` with the following content:

```{r eval = FALSE}
```{r results='hide'}
# Generated by biocroxytest: do not edit by hand!
# File R/functions.R: @longtests
test_that("Function foo() @ L11", {
expect_equal(foo(2), sqrt(2))
expect_error(foo("a string"))
testthat::test_that("Function foo() @ L11", {
testthat::expect_equal(foo(2), sqrt(2))
testthat::expect_error(foo("a string"))
})
```

Expand Down

0 comments on commit 46fc441

Please sign in to comment.