Running ‘test-all.R’ [1s/2s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > test_check("divest")
  Loading required package: divest
  ── 1. Error: DICOM-reading code works (@test-05-read.R#6)  ─────────────────────
  DICOM scan failed
  1: expect_output(d <- readDicom(path, interactive = FALSE), "Found 4 DICOM") at testthat/test-05-read.R:6
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: readDicom(path, interactive = FALSE)
  11: lapply(path, function(p) {
         if (usingTempDirectory) {
             absolute <- grepl(paste0("^([A-Za-z]:)?", .Platform$file.sep), p)
             p[!absolute] <- file.path("..", p[!absolute])
             readFromTempDirectory(".divest", p)
         }
         else if (!file.exists(p)) {
             warning(paste0("Path \"", p, "\" does not exist"))
             return(NULL)
         }
         else if (!file.info(p)$isdir) 
             .readPath(path.expand(p), flipY, crop, forceStack, verbosity, labelFormat, 
                 TRUE, FALSE)
         else if (interactive) {
             p <- path.expand(p)
             info <- .sortInfoTable(.readPath(p, flipY, crop, forceStack, min(0L, verbosity), 
                 labelFormat, FALSE, TRUE))
             nSeries <- nrow(info)
             if (nSeries < 1) 
                 return(NULL)
             digits <- floor(log10(nSeries)) + 1
             seriesNumbers <- sprintf(paste0("%", digits, "d: "), seq_len(nSeries))
             cat(paste0("\n", seriesNumbers, attr(info, "descriptions")))
             cat("\n\nType <Enter> for all series, 0 for none, or indices separated by spaces or commas")
             selection <- .readline("\nSelected series: ")
             if (selection == "") {
                 allResults <- .readPath(p, flipY, crop, forceStack, verbosity, labelFormat, 
                     FALSE, FALSE)
                 return(allResults[attr(info, "ordering")])
             }
             else if (selection == "0") 
                 return(list())
             else {
                 selection <- as.integer(unlist(strsplit(selection, "[, ]+", perl = TRUE)))
                 selectedResults <- lapply(selection, function(s) {
                     files <- attr(info, "paths")[[s]]
                     files <- paste("..", substring(files, nchar(p) + 1), sep = .Platform$file.sep)
                     readFromTempDirectory(file.path(p, paste0(".divest", as.character(s))), 
                       files)
                 })
                 return(do.call(c, selectedResults))
             }
         }
         else .readPath(path.expand(p), flipY, crop, forceStack, verbosity, labelFormat, 
             FALSE, FALSE)
     })
  12: FUN(X[[i]], ...)
  13: .readPath(path.expand(p), flipY, crop, forceStack, verbosity, labelFormat, FALSE, 
         FALSE)
  
  ── 2. Error: we can read JPEG-encoded data sets (@test-05-read.R#45)  ──────────
  DICOM scan failed
  1: capture_output(r <- readDicom(rawpath, interactive = FALSE)) at testthat/test-05-read.R:45
  2: capture_output_lines(code, print, width = width)
  3: eval_with_output(code, print = print, width = width)
  4: withr::with_output_sink(temp, withVisible(code))
  5: force(code)
  6: withVisible(code)
  7: readDicom(rawpath, interactive = FALSE)
  8: lapply(path, function(p) {
         if (usingTempDirectory) {
             absolute <- grepl(paste0("^([A-Za-z]:)?", .Platform$file.sep), p)
             p[!absolute] <- file.path("..", p[!absolute])
             readFromTempDirectory(".divest", p)
         }
         else if (!file.exists(p)) {
             warning(paste0("Path \"", p, "\" does not exist"))
             return(NULL)
         }
         else if (!file.info(p)$isdir) 
             .readPath(path.expand(p), flipY, crop, forceStack, verbosity, labelFormat, 
                 TRUE, FALSE)
         else if (interactive) {
             p <- path.expand(p)
             info <- .sortInfoTable(.readPath(p, flipY, crop, forceStack, min(0L, verbosity), 
                 labelFormat, FALSE, TRUE))
             nSeries <- nrow(info)
             if (nSeries < 1) 
                 return(NULL)
             digits <- floor(log10(nSeries)) + 1
             seriesNumbers <- sprintf(paste0("%", digits, "d: "), seq_len(nSeries))
             cat(paste0("\n", seriesNumbers, attr(info, "descriptions")))
             cat("\n\nType <Enter> for all series, 0 for none, or indices separated by spaces or commas")
             selection <- .readline("\nSelected series: ")
             if (selection == "") {
                 allResults <- .readPath(p, flipY, crop, forceStack, verbosity, labelFormat, 
                     FALSE, FALSE)
                 return(allResults[attr(info, "ordering")])
             }
             else if (selection == "0") 
                 return(list())
             else {
                 selection <- as.integer(unlist(strsplit(selection, "[, ]+", perl = TRUE)))
                 selectedResults <- lapply(selection, function(s) {
                     files <- attr(info, "paths")[[s]]
                     files <- paste("..", substring(files, nchar(p) + 1), sep = .Platform$file.sep)
                     readFromTempDirectory(file.path(p, paste0(".divest", as.character(s))), 
                       files)
                 })
                 return(do.call(c, selectedResults))
             }
         }
         else .readPath(path.expand(p), flipY, crop, forceStack, verbosity, labelFormat, 
             FALSE, FALSE)
     })
  9: FUN(X[[i]], ...)
  10: .readPath(path.expand(p), flipY, crop, forceStack, verbosity, labelFormat, FALSE, 
         FALSE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 4 SKIPPED: 0 FAILED: 2
  1. Error: DICOM-reading code works (@test-05-read.R#6) 
  2. Error: we can read JPEG-encoded data sets (@test-05-read.R#45) 
  
  Error: testthat unit tests failed
  Execution halted