-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from krlmlr/inline-rox
Allow roxygen comments in object to be documented
- Loading branch information
Showing
3 changed files
with
43 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
context("Inline") | ||
roc <- rd_roclet() | ||
|
||
test_that("Inline comments are supported", { | ||
out <- roc_proc_text(roc, " | ||
#' Description | ||
a <- function(x) { | ||
#' @param x an integer | ||
stopifnot(is.integer(x)) | ||
}")[[1]] | ||
expect_equal(get_tag(out, "param")$values, c(x="an integer")) | ||
}) | ||
|
||
test_that("Inline comments just before the closing brace are allowed", { | ||
out <- roc_proc_text(roc, " | ||
#' Description | ||
a <- function(x) { | ||
#' @param x an integer | ||
stopifnot(is.integer(x)) | ||
#' @seealso somewhere | ||
}")[[1]] | ||
expect_equal(get_tag(out, "seealso")$value, "somewhere") | ||
}) | ||
|
||
test_that("Inline comments do not extend past the closing brace", { | ||
out <- roc_proc_text(roc, " | ||
#' Description | ||
a <- function(x) { | ||
#' @param x an integer | ||
stopifnot(is.integer(x)) | ||
}; #' @seealso somewhere")[[1]] | ||
expect_null(get_tag(out, "seealso")) | ||
}) |