Skip to content

Commit

Permalink
addressing CRAN feedback - adding return docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgkf committed Mar 29, 2024
1 parent b631093 commit f7b9406
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
3 changes: 3 additions & 0 deletions R/register-s3.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
#' the old namespace. This might cause crashes because of dangling
#' `.Call()` pointers.
#'
#' @return No return value, called for side-effect of registering an S3
#' generic.
#'
#' @examples
#' # A typical use case is to dynamically register tibble/pillar methods
#' # for your class. That way you avoid creating a hard dependency on packages
Expand Down
15 changes: 4 additions & 11 deletions R/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @inheritParams testex
#'
#' @examples
#' \dontrun{library(testthat)
#' library(testthat)
#'
#' # example code
#' 1 + 2
Expand All @@ -31,15 +31,9 @@
#'
#' # `with_srcref` to spoof the source of the code that caused the failure
#' test_that("test failure is spoofed to report error at abc.R:1:0", {
#' with_srcref("abc.R:1:3", expect_equal(1, 2))
#' with_srcref("abc.R:1:3", expect_equal(., 3))
#' })
#'
#' # `expect_no_error`
#' test_that("expectation runs without error", {
#' expect_no_error(stop("whoops!"))
#' })
#' })
#' }
#' })
#'
#' @name testex-testthat
NULL
Expand Down Expand Up @@ -175,9 +169,8 @@ fallback_expect_no_error <- function(object, ...) {
#' generated test files.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' library(pkg.example) # from /inst/pkg.example
#'
#' path <- system.file("pkg.example", package = "testex")
#' test_examples_as_testthat(path = path)
#' }
Expand Down
4 changes: 4 additions & 0 deletions man/s3_register.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/test_examples_as_testthat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions man/testex-testthat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f7b9406

Please sign in to comment.