Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(autothresholdr)
  > 
  > test_check("autothresholdr")
  ── 1. Error: (unknown) (@test_stack_thresh.R#1)  ───────────────────────────────
  no field, method or inner class called 'handled' 
  1: test_that("mean_stack_thresh works", {
         library(EBImage)
         img <- imageData(readImage(system.file("extdata", "50.tif", package = "autothresholdr"), 
             as.is = TRUE))
         img_thresh_mask <- mean_stack_thresh(img, "Otsu")
         expect_equal(round(mean(img_thresh_mask, na.rm = TRUE), 2), 24.09)
         img_thresh_mask <- mean_stack_thresh(img, 13.2)
         expect_equal(round(mean(img_thresh_mask, na.rm = TRUE), 2), 24.09)
         img_thresh_mask <- med_stack_thresh(img, "Triangle")
         expect_equal(round(mean(img_thresh_mask, na.rm = TRUE), 3), 23.622)
         img_thresh_mask <- med_stack_thresh(img + 2^32, "Triangle")
         expect_equal(round(mean(img_thresh_mask, na.rm = TRUE), 3), 23.622 + 2^32)
         img_thresh_mask <- mean_stack_thresh(img + 2^32, "Otsu")
         expect_equal(round(mean(img_thresh_mask, na.rm = TRUE), 2), 24.09 + 2^32)
         const.arr <- array(2, dim = rep(2, 3))
         expect_error(mean_stack_thresh(const.arr, "tri"))
         expect_error(med_stack_thresh(const.arr, "tri"))
         expect_equal(sum(var_pillars(const.arr)), 0)
     }) at testthat/test_stack_thresh.R:1
  2: test_code(desc, code, env = parent.frame())
  3: tryCatch(withCallingHandlers({
         eval(code, test_env)
         if (!handled && !is.null(test)) {
             skip_empty()
         }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
         message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) {
     })
  4: tryCatchList(expr, classes, parentenv, handlers)
  5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], 
         parentenv, handlers[[nh]])
  6: doTryCatch(return(expr), name, parentenv, handler)
  7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: value[[3L]](cond)
  10: isTRUE(e$handled)
  11: e$handled
  12: `$.Throwable`(e, "handled")
  13: ._jobjRef_dollar(x[["jobj"]], name)
  14: stop(sprintf("no field, method or inner class called '%s' ", name))
  
  ── 2. Error: (unknown) (@test_thresh.R#3)  ─────────────────────────────────────
  no field, method or inner class called 'handled' 
  1: test_that("auto_thresh works", {
         img <- EBImage::readImage(system.file("extdata", "eg.tif", package = "autothresholdr"), 
             as.is = TRUE)
         expect_equal(auto_thresh(img, "IJD"), auto_thresh(img, "default"))
         expect_equal(auto_thresh(img, "H"), 5)
         expect_equal(auto_thresh(img, "huang", ignore_white = TRUE), 5)
         expect_equal(auto_thresh(img, "huang", ignore_white = 255), 5)
         expect_error(auto_thresh(img, "huang", ignore_white = "rory"))
         expect_error(auto_thresh(img, "huang", ignore_white = "rory"))
         expect_equal(auto_thresh(img, "tri"), 3)
         expect_equal(auto_thresh(img, "Otsu"), 13)
         expect_equal(auto_thresh(img, 99), 99)
         mask <- auto_thresh_mask(img, "huang")
         expect_equal(EBImage::imageData(mask), EBImage::imageData(img > 5))
         masked <- EBImage::imageData(auto_thresh_apply_mask(img, "huang"))
         masked5 <- img %T>% {
             .[. <= 5] <- NA
         } %>% EBImage::imageData()
         expect_equal(masked, masked5)
         img_neg <- img %T>% {
             .[1] <- -1
         }
         expect_error(auto_thresh(img_neg, "huang"))
         expect_error(auto_thresh(matrix(1, nrow = 2, ncol = 2), "huang"))
     }) at testthat/test_thresh.R:3
  2: test_code(desc, code, env = parent.frame())
  3: tryCatch(withCallingHandlers({
         eval(code, test_env)
         if (!handled && !is.null(test)) {
             skip_empty()
         }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
         message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) {
     })
  4: tryCatchList(expr, classes, parentenv, handlers)
  5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], 
         parentenv, handlers[[nh]])
  6: doTryCatch(return(expr), name, parentenv, handler)
  7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: value[[3L]](cond)
  10: isTRUE(e$handled)
  11: e$handled
  12: `$.Throwable`(e, "handled")
  13: ._jobjRef_dollar(x[["jobj"]], name)
  14: stop(sprintf("no field, method or inner class called '%s' ", name))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 2 SKIPPED: 0 FAILED: 2
  1. Error: (unknown) (@test_stack_thresh.R#1) 
  2. Error: (unknown) (@test_thresh.R#3) 
  
  Error: testthat unit tests failed
  Execution halted