tests/testthat/helper-redux.R

redis_cmds <- redis_api(list(command = identity))

REDIS_VERSION <- tryCatch(
  redis_version(test_hiredis_connection()),
  skip = function(e) numeric_version("0.0.0"),
  error = function(e) numeric_version("0.0.0"))
REDIS_HOST <- redis_config()$host
REDIS_PORT <- redis_config()$port

skip_if_cmd_unsupported <- function(cmd) {
  if (cmd_since[[cmd]] <= REDIS_VERSION) {
    return()
  }
  if (REDIS_VERSION == numeric_version("0.0.0")) {
    testthat::skip("Redis is not available")
  }
  testthat::skip(
    sprintf("command %s not supported in server redis version", cmd))
}

Try the redux package in your browser

Any scripts or data that you put into this service are public.

redux documentation built on Jan. 12, 2022, 5:09 p.m.