Running 'testthat.R' [5s/6s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(imagefluency)
  > 
  > test_check("imagefluency")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  imagefluency
   --- call from context --- 
  rotate90(img)
   --- call from argument --- 
  if (class(img) == "matrix") {
      return(rot90(img, direction))
  } else if (class(img) == "array") {
      out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
      for (i in seq_len(dim(img)[3])) {
          out[, , i] <- rot90(img[, , i], direction)
      }
      return(out)
  } else {
      stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
          call. = FALSE)
  }
   --- R stacktrace ---
  where 1: rotate90(img)
  where 2: .sym(rotate90(img), color = FALSE, ...)
  where 3: img_symmetry(img1)
  where 4: eval_bare(expr, quo_get_env(quo))
  where 5: quasi_label(enquo(object), label, arg = "object")
  where 6 at testthat/test_symmetry.R#10: expect_equal(img_symmetry(img1)[1], c(vertical = 1))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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)
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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) {
      })
  where 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test_symmetry.R#3: test_that("img_symmetry detects perfect symmetry", {
      img1 <- matrix(0, nrow = 100, ncol = 100)
      img1[41:60, 41:60] <- 1
      expect_equal(img_symmetry(img1)[1], c(vertical = 1))
      expect_equal(img_symmetry(img1)[2], c(horizontal = 1))
  })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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)
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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) {
      })
  where 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 45: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 46: test_check("imagefluency")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (img, direction = "positive") 
  {
      rot90 <- function(A, dir = "positive") {
          height <- dim(A)[1]
          width <- dim(A)[2]
          A <- t(A)
          if (dir == "positive" | dir == "counterclockwise") {
              return(A[width:1, ])
          }
          if (dir == "negative" | dir == "clockwise") {
              return(A[, height:1])
          }
      }
      if (!(direction == "positive" | direction == "counterclockwise" | 
          direction == "negative" | direction == "clockwise")) {
          stop(paste0("'", direction, "' is an unknown input to parameter 'direction'. Try 'direction = positive' or 'direction = negative'."))
      }
      if (class(img) == "matrix") {
          return(rot90(img, direction))
      }
      else if (class(img) == "array") {
          out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
          for (i in seq_len(dim(img)[3])) {
              out[, , i] <- rot90(img[, , i], direction)
          }
          return(out)
      }
      else {
          stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
              call. = FALSE)
      }
  }
  <bytecode: 0x3ed9918>
  <environment: namespace:imagefluency>
   --- function search by body ---
  Function rotate90 in namespace imagefluency has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 1. Error: img_symmetry detects perfect symmetry (@test_symmetry.R#10)  ------
  the condition has length > 1
  Backtrace:
   1. testthat::expect_equal(img_symmetry(img1)[1], c(vertical = 1))
   4. imagefluency::img_symmetry(img1)
   6. imagefluency::rotate90(img)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  imagefluency
   --- call from context --- 
  rotate90(img)
   --- call from argument --- 
  if (class(img) == "matrix") {
      return(rot90(img, direction))
  } else if (class(img) == "array") {
      out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
      for (i in seq_len(dim(img)[3])) {
          out[, , i] <- rot90(img[, , i], direction)
      }
      return(out)
  } else {
      stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
          call. = FALSE)
  }
   --- R stacktrace ---
  where 1: rotate90(img)
  where 2: .sym(rotate90(img), color = FALSE, ...)
  where 3: img_symmetry(img2)
  where 4: eval_bare(expr, quo_get_env(quo))
  where 5: quasi_label(enquo(object), label, arg = "object")
  where 6 at testthat/test_symmetry.R#22: expect_lt(img_symmetry(img2)[1], c(vertical = 1))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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)
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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) {
      })
  where 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test_symmetry.R#14: test_that("img_symmetry detects horizontal symmetry", {
      img2 <- matrix(0, nrow = 50, ncol = 50)
      img2[21:30, 16:30] <- 1
      img2[11:40, 31:40] <- 1
      expect_lt(img_symmetry(img2)[1], c(vertical = 1))
      expect_identical(img_symmetry(img2)[2], c(horizontal = 1))
  })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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)
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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) {
      })
  where 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 45: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 46: test_check("imagefluency")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (img, direction = "positive") 
  {
      rot90 <- function(A, dir = "positive") {
          height <- dim(A)[1]
          width <- dim(A)[2]
          A <- t(A)
          if (dir == "positive" | dir == "counterclockwise") {
              return(A[width:1, ])
          }
          if (dir == "negative" | dir == "clockwise") {
              return(A[, height:1])
          }
      }
      if (!(direction == "positive" | direction == "counterclockwise" | 
          direction == "negative" | direction == "clockwise")) {
          stop(paste0("'", direction, "' is an unknown input to parameter 'direction'. Try 'direction = positive' or 'direction = negative'."))
      }
      if (class(img) == "matrix") {
          return(rot90(img, direction))
      }
      else if (class(img) == "array") {
          out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
          for (i in seq_len(dim(img)[3])) {
              out[, , i] <- rot90(img[, , i], direction)
          }
          return(out)
      }
      else {
          stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
              call. = FALSE)
      }
  }
  <bytecode: 0x3ed9918>
  <environment: namespace:imagefluency>
   --- function search by body ---
  Function rotate90 in namespace imagefluency has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 2. Error: img_symmetry detects horizontal symmetry (@test_symmetry.R#22)  ---
  the condition has length > 1
  Backtrace:
   1. testthat::expect_lt(img_symmetry(img2)[1], c(vertical = 1))
   4. imagefluency::img_symmetry(img2)
   6. imagefluency::rotate90(img)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  imagefluency
   --- call from context --- 
  rotate90(img)
   --- call from argument --- 
  if (class(img) == "matrix") {
      return(rot90(img, direction))
  } else if (class(img) == "array") {
      out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
      for (i in seq_len(dim(img)[3])) {
          out[, , i] <- rot90(img[, , i], direction)
      }
      return(out)
  } else {
      stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
          call. = FALSE)
  }
   --- R stacktrace ---
  where 1: rotate90(img)
  where 2: .sym(rotate90(img), color = FALSE, ...)
  where 3: img_symmetry(img3)
  where 4: eval_bare(expr, quo_get_env(quo))
  where 5: quasi_label(enquo(object), label, arg = "object")
  where 6 at testthat/test_symmetry.R#34: expect_identical(img_symmetry(img3)[1], c(vertical = 1))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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)
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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) {
      })
  where 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test_symmetry.R#26: test_that("img_symmetry detects vertical symmetry", {
      img3 <- matrix(0, nrow = 50, ncol = 50)
      img3[16:30, 21:30] <- 1
      img3[31:40, 11:40] <- 1
      expect_identical(img_symmetry(img3)[1], c(vertical = 1))
      expect_lt(img_symmetry(img3)[2], c(horizontal = 1))
  })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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)
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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) {
      })
  where 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 45: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 46: test_check("imagefluency")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (img, direction = "positive") 
  {
      rot90 <- function(A, dir = "positive") {
          height <- dim(A)[1]
          width <- dim(A)[2]
          A <- t(A)
          if (dir == "positive" | dir == "counterclockwise") {
              return(A[width:1, ])
          }
          if (dir == "negative" | dir == "clockwise") {
              return(A[, height:1])
          }
      }
      if (!(direction == "positive" | direction == "counterclockwise" | 
          direction == "negative" | direction == "clockwise")) {
          stop(paste0("'", direction, "' is an unknown input to parameter 'direction'. Try 'direction = positive' or 'direction = negative'."))
      }
      if (class(img) == "matrix") {
          return(rot90(img, direction))
      }
      else if (class(img) == "array") {
          out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
          for (i in seq_len(dim(img)[3])) {
              out[, , i] <- rot90(img[, , i], direction)
          }
          return(out)
      }
      else {
          stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
              call. = FALSE)
      }
  }
  <bytecode: 0x3ed9918>
  <environment: namespace:imagefluency>
   --- function search by body ---
  Function rotate90 in namespace imagefluency has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 3. Error: img_symmetry detects vertical symmetry (@test_symmetry.R#34)  -----
  the condition has length > 1
  Backtrace:
   1. testthat::expect_identical(img_symmetry(img3)[1], c(vertical = 1))
   4. imagefluency::img_symmetry(img3)
   6. imagefluency::rotate90(img)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  imagefluency
   --- call from context --- 
  rotate90(img)
   --- call from argument --- 
  if (class(img) == "matrix") {
      return(rot90(img, direction))
  } else if (class(img) == "array") {
      out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
      for (i in seq_len(dim(img)[3])) {
          out[, , i] <- rot90(img[, , i], direction)
      }
      return(out)
  } else {
      stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
          call. = FALSE)
  }
   --- R stacktrace ---
  where 1: rotate90(img)
  where 2: .sym(rotate90(img), color = FALSE, ...)
  where 3: img_symmetry(img1)
  where 4: eval_bare(expr, quo_get_env(quo))
  where 5: quasi_label(enquo(object), label, arg = "object")
  where 6 at testthat/test_symmetry.R#46: expect_equal(img_symmetry(img1), img_symmetry(img2))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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)
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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) {
      })
  where 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test_symmetry.R#38: test_that("img_symmetry detects symmetry for inverted image", 
      {
          img1 <- matrix(0, nrow = 100, ncol = 100)
          img1[41:60, 41:60] <- 1
          img2 <- 1 - img1
          expect_equal(img_symmetry(img1), img_symmetry(img2))
      })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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)
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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) {
      })
  where 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 45: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 46: test_check("imagefluency")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (img, direction = "positive") 
  {
      rot90 <- function(A, dir = "positive") {
          height <- dim(A)[1]
          width <- dim(A)[2]
          A <- t(A)
          if (dir == "positive" | dir == "counterclockwise") {
              return(A[width:1, ])
          }
          if (dir == "negative" | dir == "clockwise") {
              return(A[, height:1])
          }
      }
      if (!(direction == "positive" | direction == "counterclockwise" | 
          direction == "negative" | direction == "clockwise")) {
          stop(paste0("'", direction, "' is an unknown input to parameter 'direction'. Try 'direction = positive' or 'direction = negative'."))
      }
      if (class(img) == "matrix") {
          return(rot90(img, direction))
      }
      else if (class(img) == "array") {
          out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
          for (i in seq_len(dim(img)[3])) {
              out[, , i] <- rot90(img[, , i], direction)
          }
          return(out)
      }
      else {
          stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
              call. = FALSE)
      }
  }
  <bytecode: 0x3ed9918>
  <environment: namespace:imagefluency>
   --- function search by body ---
  Function rotate90 in namespace imagefluency has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 4. Error: img_symmetry detects symmetry for inverted image (@test_symmetry.R#
  the condition has length > 1
  Backtrace:
   1. testthat::expect_equal(img_symmetry(img1), img_symmetry(img2))
   4. imagefluency::img_symmetry(img1)
   6. imagefluency::rotate90(img)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  imagefluency
   --- call from context --- 
  rotate90(mat)
   --- call from argument --- 
  if (class(img) == "matrix") {
      return(rot90(img, direction))
  } else if (class(img) == "array") {
      out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
      for (i in seq_len(dim(img)[3])) {
          out[, , i] <- rot90(img[, , i], direction)
      }
      return(out)
  } else {
      stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
          call. = FALSE)
  }
   --- R stacktrace ---
  where 1: rotate90(mat)
  where 2: eval_bare(expr, quo_get_env(quo))
  where 3: quasi_label(enquo(object), label, arg = "object")
  where 4 at testthat/test_utils.R#55: expect_equal(rotate90(mat), matrix(c(3, 1, 4, 2), ncol = 2))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: 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)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: 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) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_utils.R#48: test_that("rotate90 correctly rotates clockwise and counterclockwise", 
      {
          mat <- matrix(1:4, ncol = 2)
          arr <- array(c(matrix(1:4, 2), matrix(5:8, 2), matrix(9:12, 
              2)), dim = c(2, 2, 3))
          expect_equal(rotate90(mat), matrix(c(3, 1, 4, 2), ncol = 2))
          expect_equal(rotate90(mat, direction = "positive"), matrix(c(3, 
              1, 4, 2), ncol = 2))
          expect_equal(rotate90(mat, direction = "counterclockwise"), 
              matrix(c(3, 1, 4, 2), ncol = 2))
          expect_equal(rotate90(mat, direction = "negative"), matrix(c(2, 
              4, 1, 3), ncol = 2))
          expect_equal(rotate90(mat, direction = "clockwise"), 
              matrix(c(2, 4, 1, 3), ncol = 2))
          expect_equal(rotate90(arr), array(c(rotate90(matrix(1:4, 
              2)), rotate90(matrix(5:8, 2)), rotate90(matrix(9:12, 
              2))), dim = c(2, 2, 3)))
      })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: 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)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: 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) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("imagefluency")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (img, direction = "positive") 
  {
      rot90 <- function(A, dir = "positive") {
          height <- dim(A)[1]
          width <- dim(A)[2]
          A <- t(A)
          if (dir == "positive" | dir == "counterclockwise") {
              return(A[width:1, ])
          }
          if (dir == "negative" | dir == "clockwise") {
              return(A[, height:1])
          }
      }
      if (!(direction == "positive" | direction == "counterclockwise" | 
          direction == "negative" | direction == "clockwise")) {
          stop(paste0("'", direction, "' is an unknown input to parameter 'direction'. Try 'direction = positive' or 'direction = negative'."))
      }
      if (class(img) == "matrix") {
          return(rot90(img, direction))
      }
      else if (class(img) == "array") {
          out <- array(NA, dim = c(dim(img)[2], dim(img)[1], dim(img)[3]))
          for (i in seq_len(dim(img)[3])) {
              out[, , i] <- rot90(img[, , i], direction)
          }
          return(out)
      }
      else {
          stop(paste0("Unknown input of type '", class(img), "' (has to be of type 'matrix' or 'array')"), 
              call. = FALSE)
      }
  }
  <bytecode: 0x3ed9918>
  <environment: namespace:imagefluency>
   --- function search by body ---
  Function rotate90 in namespace imagefluency has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 5. Error: rotate90 correctly rotates clockwise and counterclockwise (@test_ut
  the condition has length > 1
  Backtrace:
   1. testthat::expect_equal(rotate90(mat), matrix(c(3, 1, 4, 2), ncol = 2))
   4. imagefluency::rotate90(mat)
  
  == testthat results  ===========================================================
  [ OK: 47 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 5 ]
  1. Error: img_symmetry detects perfect symmetry (@test_symmetry.R#10) 
  2. Error: img_symmetry detects horizontal symmetry (@test_symmetry.R#22) 
  3. Error: img_symmetry detects vertical symmetry (@test_symmetry.R#34) 
  4. Error: img_symmetry detects symmetry for inverted image (@test_symmetry.R#46) 
  5. Error: rotate90 correctly rotates clockwise and counterclockwise (@test_utils.R#55) 
  
  Error: testthat unit tests failed
  Execution halted