Skip to content

Commit

Permalink
Remove code needed for old R versions (#2759)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgibson7 authored Aug 19, 2024
1 parent de3fe6d commit 0f565db
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
10 changes: 1 addition & 9 deletions R/rd.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ rd_text <- function(x, fragment = TRUE) {
}

rd_file <- function(path, pkg_path = NULL) {
if (getRversion() >= "3.4.0") {
macros <- tools::loadPkgRdMacros(pkg_path)
set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
} else if (getRversion() >= "3.2.0") {
macros <- tools::loadPkgRdMacros(pkg_path, TRUE)
set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
} else {
set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
}
set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
}

#' Translate an Rd string to its HTML output
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-build-home-license.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
test_that("link_license matchs exactly", {
# R 3.1 uses http url
skip_if_not(getRversion() >= "3.2.0")

# Shouldn't match first GPL-2
expect_equal(
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-build-reference.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
test_that("parse failures include file name", {
skip_if_not(getRversion() >= "4.0.0")
pkg <- local_pkgdown_site(test_path("assets/reference-fail"))
expect_snapshot(build_reference(pkg), error = TRUE)
})
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-rd-html.R
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,6 @@ test_that("deqn", {
})

test_that("special", {
# Fails due to a bug prior to R 4.0.0:
# https://bugs.r-project.org/show_bug.cgi?id=17727
skip_if_not(getRversion() >= "4.0.0")
out <- rd2html("\\special{( \\dots )}")
expect_equal(out, "( ... )")
})
Expand Down

0 comments on commit 0f565db

Please sign in to comment.