tests/marshal.magick.R

library(marshal)

if (requireNamespace("magick", quietly = TRUE)) {
  img <- magick::logo
  print(img)

  ## Assert non-marshallability
  stopifnot(!marshallable(img))

  ## Marshal read-only connection, which records the
  ## current state, including the current file position.
  res <- tryCatch({
    marshal(img)
  }, error = identity)
  stopifnot(
    inherits(res, "error"),
    inherits(res, "MarshalNotSupportedError")
  )
}
HenrikBengtsson/marshal documentation built on June 11, 2024, 11:35 a.m.