Skip to content

Commit 0f565db

Browse files
authored
Remove code needed for old R versions (#2759)
1 parent de3fe6d commit 0f565db

File tree

4 files changed

+1
-15
lines changed

4 files changed

+1
-15
lines changed

R/rd.R

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ rd_text <- function(x, fragment = TRUE) {
66
}
77

88
rd_file <- function(path, pkg_path = NULL) {
9-
if (getRversion() >= "3.4.0") {
10-
macros <- tools::loadPkgRdMacros(pkg_path)
11-
set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
12-
} else if (getRversion() >= "3.2.0") {
13-
macros <- tools::loadPkgRdMacros(pkg_path, TRUE)
14-
set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
15-
} else {
16-
set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
17-
}
9+
set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
1810
}
1911

2012
#' Translate an Rd string to its HTML output

tests/testthat/test-build-home-license.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
test_that("link_license matchs exactly", {
2-
# R 3.1 uses http url
3-
skip_if_not(getRversion() >= "3.2.0")
42

53
# Shouldn't match first GPL-2
64
expect_equal(

tests/testthat/test-build-reference.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
test_that("parse failures include file name", {
2-
skip_if_not(getRversion() >= "4.0.0")
32
pkg <- local_pkgdown_site(test_path("assets/reference-fail"))
43
expect_snapshot(build_reference(pkg), error = TRUE)
54
})

tests/testthat/test-rd-html.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,6 @@ test_that("deqn", {
428428
})
429429

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

0 commit comments

Comments
 (0)