diff --git a/tests/testthat/_snaps/rd-family.md b/tests/testthat/_snaps/rd-family.md new file mode 100644 index 00000000..f35fc261 --- /dev/null +++ b/tests/testthat/_snaps/rd-family.md @@ -0,0 +1,63 @@ +# careful ordering + + Code + out + Output + $foo1.Rd + % Generated by roxygen2: do not edit by hand + % Please edit documentation in ./ + \name{foo1} + \alias{foo1} + \title{foo1} + \usage{ + foo1() + } + \description{ + foo1 + } + \seealso{ + Other a: + \code{\link{foo2}()}, + \code{\link{foo}()} + } + \concept{a} + + $foo2.Rd + % Generated by roxygen2: do not edit by hand + % Please edit documentation in ./ + \name{foo2} + \alias{foo2} + \title{foo2} + \usage{ + foo2() + } + \description{ + foo2 + } + \seealso{ + Other a: + \code{\link{foo1}()}, + \code{\link{foo}()} + } + \concept{a} + + $foo.Rd + % Generated by roxygen2: do not edit by hand + % Please edit documentation in ./ + \name{foo} + \alias{foo} + \title{foo} + \usage{ + foo() + } + \description{ + foo + } + \seealso{ + Other a: + \code{\link{foo1}()}, + \code{\link{foo2}()} + } + \concept{a} + + diff --git a/tests/testthat/test-rd-family.R b/tests/testthat/test-rd-family.R index d6e8eacf..6fcdb546 100644 --- a/tests/testthat/test-rd-family.R +++ b/tests/testthat/test-rd-family.R @@ -123,3 +123,24 @@ test_that("custom family prefixes can be set", { expect_match(out$get_value("seealso"), "^Custom prefix:") }) + +test_that("careful ordering", { + + out <- roc_proc_text(rd_roclet(), " + #' foo1 + #' @family a + foo1 <- function() {} + + #' foo2 + #' @family a + foo2 <- function() {} + + #' foo + #' @family a + foo <- function() {} + ") + + expect_snapshot({ + out + }) +})