Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 23, 2023
1 parent ff0ea69 commit 60621e8
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
63 changes: 63 additions & 0 deletions tests/testthat/_snaps/rd-family.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# careful ordering

Code
out
Output
$foo1.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in ./<text>
\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 ./<text>
\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 ./<text>
\name{foo}
\alias{foo}
\title{foo}
\usage{
foo()
}
\description{
foo
}
\seealso{
Other a:
\code{\link{foo1}()},
\code{\link{foo2}()}
}
\concept{a}

21 changes: 21 additions & 0 deletions tests/testthat/test-rd-family.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
})

0 comments on commit 60621e8

Please sign in to comment.