Skip to content

Commit 01496dd

Browse files
backtrack: no default
1 parent ba80e90 commit 01496dd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

R/skip.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ package_version <- function(x) {
128128

129129
#' @export
130130
#' @param spec A version specification like '>= 4.1.0' denoting that this test
131-
#' should only be run on R versions 4.1.0 and later. If the comparison
132-
#' operator is omitted, '>=' is assumed.
131+
#' should only be run on R versions 4.1.0 and later.
133132
#' @rdname skip
134133
skip_unless_r <- function(spec) {
135134
parts <- unlist(strsplit(spec, " ", fixed = TRUE))
136-
if (length(parts) == 1L) parts <- c(">=", parts)
135+
if (length(parts) != 2L) {
136+
abort("`spec` should be a comparison like '>=' and an R version.")
137+
}
137138
comparator <- match.fun(parts[1L])
138139
required_version <- numeric_version(parts[2L])
139140

man/skip.Rd

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)