Skip to content

Commit

Permalink
pass doc_range from .Rd to get_int_range fn; closes #66
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Nov 24, 2021
1 parent 842b470 commit dbdf264
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: autotest
Title: Automatic Package Testing
Version: 0.0.2.172
Version: 0.0.2.173
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265")),
Expand Down
17 changes: 12 additions & 5 deletions R/input-int.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,19 @@ test_single_int_range.autotest_obj <- function (x, test_data = NULL, ...) { # no

single_int_range <- function (x) {

int_range <- get_int_range (x$fn, x$params, x$i)
rd <- get_Rd_param (package = x$package_loc,
fn_name = x$fn,
param_name = names (x$params) [x$i])

doc_range <- documented_int_range (rd)

int_range <- get_int_range (x$fn, x$params, x$i, doc_range)

if (!is.numeric (int_range)) # call with default parameters errored
return (int_range)

res <- NULL

rd <- get_Rd_param (package = x$package_loc,
fn_name = x$fn,
param_name = names (x$params) [x$i])

res_out <- test_single_int_range.NULL ()
res_out$type <- "diagnostic"
res_out$fn_name <- x$fn
Expand Down Expand Up @@ -132,6 +134,11 @@ single_int_range <- function (x) {
return (res)
}

#' Get permissible integer range from a given .Rd entry
#'
#' @return Vector of two integer values of (lower, upper) limits, with default
#' of +/- Inf.
#' @noRd
documented_int_range <- function (rd) {

int_from_rd <- function (rd, ptn) {
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/autotest",
"issueTracker": "https://github.com/ropensci-review-tools/autotest/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.2.172",
"version": "0.0.2.173",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit dbdf264

Please sign in to comment.