tests/testthat/helper.R

library(RBaseX)
library(testthat)
library(glue)

skip_unless_socket_available <- function() {
    tryCatch({
    sock <- base::socketConnection(
      host = "localhost", 1984,
      open = "w+b", server = FALSE, blocking = FALSE, encoding = "utf-8")
    close(sock)
    TRUE
  }, error = function(e) {
    skip(paste0("basexserver not available:\n'", conditionMessage(e), "'"))
  })
}
BenEngbers/RBaseX documentation built on Nov. 14, 2022, 12:45 a.m.