Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(texPreview)
  > test_check("texPreview")
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-error.R:16:5): force an error: error message ──────────────────
  `texPreview::tex_preview(tex, marker = FALSE)` threw an error with unexpected message.
  Expected match: "Extra alignment tab"
  Actual message: "invalid 'path' argument"
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-error.R:16:4
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─texPreview::tex_preview(tex, marker = FALSE)
    7. └─texPreview:::tex_preview.character(tex, marker = FALSE)
    8.   └─texPreview:::tex_preview.default(...)
    9.     └─texPreview:::tex_cleanup(cleanup, stem, keep_pdf, keep_log)
   10.       └─base::list.files(...)
  ── Error (test-kable.R:85:1): (code run outside of `test_that()`) ──────────────
  Error in `if (file == "") file <- stdout() else if (startsWith(file, "|")) {
      file <- pipe(substring(file, 2L), "w")
      on.exit(close(file))
  } else {
      file <- file(file, ifelse(append, "a", "w"))
      on.exit(close(file))
  }`: argument is of length zero
  Backtrace:
      █
   1. └─testthat::describe(...) test-kable.R:85:0
   2.   └─base::eval(substitute(code), describe_environment)
   3.     └─base::eval(substitute(code), describe_environment)
   4.       ├─texPreview::tex_preview(tex, returnType = "input") test-kable.R:87:2
   5.       └─texPreview:::tex_preview.character(tex, returnType = "input")
   6.         └─texPreview:::tex_preview.default(...)
   7.           └─texPreview:::build_lines(obj, stem, tex_opts$get("usrPackages"))
   8.             └─base::cat(obj, file = tex_path(fileDir, stem), sep = "\n")
  ── Error (test-kable.R:85:1): (code run outside of `test_that()`) ──────────────
  Error in `list.files(fileDir, sprintf("%s(.*?)(%s)", stem, paste0(cleanup, 
      collapse = "|")), full.names = TRUE)`: invalid 'path' argument
  Backtrace:
      █
   1. └─testthat::describe(...) test-kable.R:85:0
   2.   └─base::eval(substitute(code), describe_environment)
   3.     └─base::eval(substitute(code), describe_environment)
   4.       ├─texPreview::tex_preview(tex, returnType = "input") test-kable.R:87:2
   5.       └─texPreview:::tex_preview.character(tex, returnType = "input")
   6.         └─texPreview:::tex_preview.default(...)
   7.           └─texPreview:::tex_cleanup(cleanup, stem, keep_pdf, keep_log)
   8.             └─base::list.files(...)
  ── Error (test-print.R:13:1): (code run outside of `test_that()`) ──────────────
  Error in `if (file == "") file <- stdout() else if (startsWith(file, "|")) {
      file <- pipe(substring(file, 2L), "w")
      on.exit(close(file))
  } else {
      file <- file(file, ifelse(append, "a", "w"))
      on.exit(close(file))
  }`: argument is of length zero
  Backtrace:
      █
   1. └─testthat::describe(...) test-print.R:13:0
   2.   └─base::eval(substitute(code), describe_environment)
   3.     └─base::eval(substitute(code), describe_environment)
   4.       ├─texPreview::tex_preview(tex, returnType = "tex") test-print.R:15:2
   5.       └─texPreview:::tex_preview.character(tex, returnType = "tex")
   6.         └─texPreview:::tex_preview.default(...)
   7.           └─texPreview:::build_lines(obj, stem, tex_opts$get("usrPackages"))
   8.             └─base::cat(obj, file = tex_path(fileDir, stem), sep = "\n")
  ── Error (test-print.R:13:1): (code run outside of `test_that()`) ──────────────
  Error in `list.files(fileDir, sprintf("%s(.*?)(%s)", stem, paste0(cleanup, 
      collapse = "|")), full.names = TRUE)`: invalid 'path' argument
  Backtrace:
      █
   1. └─testthat::describe(...) test-print.R:13:0
   2.   └─base::eval(substitute(code), describe_environment)
   3.     └─base::eval(substitute(code), describe_environment)
   4.       ├─texPreview::tex_preview(tex, returnType = "tex") test-print.R:15:2
   5.       └─texPreview:::tex_preview.character(tex, returnType = "tex")
   6.         └─texPreview:::tex_preview.default(...)
   7.           └─texPreview:::tex_cleanup(cleanup, stem, keep_pdf, keep_log)
   8.             └─base::list.files(...)
  ── Error (test-rmd.R:7:1): (code run outside of `test_that()`) ─────────────────
  Error in `if (file == "") file <- stdout() else if (startsWith(file, "|")) {
      file <- pipe(substring(file, 2L), "w")
      on.exit(close(file))
  } else {
      file <- file(file, ifelse(append, "a", "w"))
      on.exit(close(file))
  }`: argument is of length zero
  Backtrace:
       █
    1. ├─testthat::describe(...) test-rmd.R:7:0
    2. │ └─base::eval(substitute(code), describe_environment)
    3. │   └─base::eval(substitute(code), describe_environment)
    4. │     └─texPreview:::safe_render(...) test-rmd.R:9:2
    5. │       ├─rmarkdown::render(...) helper-functions.R:27:2
    6. │       │ └─knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
    7. │       │   └─knitr:::process_file(text, output)
    8. │       │     ├─base::withCallingHandlers(...)
    9. │       │     ├─knitr:::process_group(group)
   10. │       │     └─knitr:::process_group.block(group)
   11. │       │       └─knitr:::call_block(x)
   12. │       │         └─knitr:::block_exec(params)
   13. │       │           └─knitr:::eng_r(options)
   14. │       │             ├─knitr:::in_dir(...)
   15. │       │             └─knitr:::evaluate(...)
   16. │       │               └─evaluate::evaluate(...)
   17. │       │                 └─evaluate:::evaluate_call(...)
   18. │       │                   ├─evaluate:::timing_fn(...)
   19. │       │                   ├─base:::handle(...)
   20. │       │                   ├─base::withCallingHandlers(...)
   21. │       │                   ├─base::withVisible(eval(expr, envir, enclos))
   22. │       │                   └─base::eval(expr, envir, enclos)
   23. │       │                     └─base::eval(expr, envir, enclos)
   24. │       └─`%>%`(...)
   25. ├─texPreview::tex_preview(., returnType = "html", stem = "test_html")
   26. └─texPreview:::tex_preview.knitr_kable(...)
   27.   ├─texPreview::tex_preview(...)
   28.   └─texPreview:::tex_preview.character(...)
   29.     └─texPreview:::tex_preview.default(...)
   30.       └─texPreview:::build_lines(obj, stem, tex_opts$get("usrPackages"))
   31.         └─base::cat(obj, file = tex_path(fileDir, stem), sep = "\n")
  ── Error (test-rmd.R:7:1): (code run outside of `test_that()`) ─────────────────
  Error in `list.files(fileDir, sprintf("%s(.*?)(%s)", stem, paste0(cleanup, 
      collapse = "|")), full.names = TRUE)`: invalid 'path' argument
  Backtrace:
       █
    1. ├─testthat::describe(...) test-rmd.R:7:0
    2. │ └─base::eval(substitute(code), describe_environment)
    3. │   └─base::eval(substitute(code), describe_environment)
    4. │     └─texPreview:::safe_render(...) test-rmd.R:9:2
    5. │       ├─rmarkdown::render(...) helper-functions.R:27:2
    6. │       │ └─knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
    7. │       │   └─knitr:::process_file(text, output)
    8. │       │     ├─base::withCallingHandlers(...)
    9. │       │     ├─knitr:::process_group(group)
   10. │       │     └─knitr:::process_group.block(group)
   11. │       │       └─knitr:::call_block(x)
   12. │       │         └─knitr:::block_exec(params)
   13. │       │           └─knitr:::eng_r(options)
   14. │       │             ├─knitr:::in_dir(...)
   15. │       │             └─knitr:::evaluate(...)
   16. │       │               └─evaluate::evaluate(...)
   17. │       │                 └─evaluate:::evaluate_call(...)
   18. │       │                   ├─evaluate:::timing_fn(...)
   19. │       │                   ├─base:::handle(...)
   20. │       │                   ├─base::withCallingHandlers(...)
   21. │       │                   ├─base::withVisible(eval(expr, envir, enclos))
   22. │       │                   └─base::eval(expr, envir, enclos)
   23. │       │                     └─base::eval(expr, envir, enclos)
   24. │       └─`%>%`(...)
   25. ├─texPreview::tex_preview(., returnType = "html", stem = "test_html")
   26. └─texPreview:::tex_preview.knitr_kable(...)
   27.   ├─texPreview::tex_preview(...)
   28.   └─texPreview:::tex_preview.character(...)
   29.     └─texPreview:::tex_preview.default(...)
   30.       └─texPreview:::tex_cleanup(cleanup, stem, keep_pdf, keep_log)
   31.         └─base::list.files(...)
  ── Error (test-tex.R:12:3): (code run outside of `test_that()`) ────────────────
  Error in `if (file == "") file <- stdout() else if (startsWith(file, "|")) {
      file <- pipe(substring(file, 2L), "w")
      on.exit(close(file))
  } else {
      file <- file(file, ifelse(append, "a", "w"))
      on.exit(close(file))
  }`: argument is of length zero
  Backtrace:
       █
    1. └─testthat::describe(...) test-tex.R:12:2
    2.   └─base::eval(substitute(code), describe_environment)
    3.     └─base::eval(substitute(code), describe_environment)
    4.       ├─texPreview::tex_preview(obj = xtable::xtable(head(iris, 10))) test-tex.R:14:6
    5.       └─texPreview:::tex_preview.xtable(...)
    6.         ├─base::do.call("print", print.xtable.opts)
    7.         ├─base::print(...)
    8.         └─xtable::print.xtable(...)
    9.           ├─base::print(result)
   10.           └─xtable:::print.string(result)
   11.             └─base::cat(x$text, file = x$file, append = x$append)
  ── Error (test-viewer.R:20:5): viewer output: validate viewer ──────────────────
  Error in `if (file == "") file <- stdout() else if (startsWith(file, "|")) {
      file <- pipe(substring(file, 2L), "w")
      on.exit(close(file))
  } else {
      file <- file(file, ifelse(append, "a", "w"))
      on.exit(close(file))
  }`: argument is of length zero
  Backtrace:
       █
    1. ├─testthat::expect_output(...) test-viewer.R:20:4
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─testthat::capture_output_lines(code, print, width = width)
    5. │   │   └─testthat:::eval_with_output(code, print = print, width = width)
    6. │   │     ├─withr::with_output_sink(temp, withVisible(code))
    7. │   │     │ └─base::force(code)
    8. │   │     └─base::withVisible(code)
    9. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   10. ├─`%>%`(...)
   11. ├─texPreview::tex_preview(., returnType = "viewer", stem = "test_viewer")
   12. └─texPreview:::tex_preview.knitr_kable(...)
   13.   ├─texPreview::tex_preview(...)
   14.   └─texPreview:::tex_preview.character(...)
   15.     └─texPreview:::tex_preview.default(...)
   16.       └─texPreview:::build_lines(obj, stem, tex_opts$get("usrPackages"))
   17.         └─base::cat(obj, file = tex_path(fileDir, stem), sep = "\n")
  ── Error (test-viewer.R:20:5): viewer output: validate viewer ──────────────────
  Error in `list.files(fileDir, sprintf("%s(.*?)(%s)", stem, paste0(cleanup, 
      collapse = "|")), full.names = TRUE)`: invalid 'path' argument
  Backtrace:
       █
    1. ├─testthat::expect_output(...) test-viewer.R:20:4
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─testthat::capture_output_lines(code, print, width = width)
    5. │   │   └─testthat:::eval_with_output(code, print = print, width = width)
    6. │   │     ├─withr::with_output_sink(temp, withVisible(code))
    7. │   │     │ └─base::force(code)
    8. │   │     └─base::withVisible(code)
    9. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   10. ├─`%>%`(...)
   11. ├─texPreview::tex_preview(., returnType = "viewer", stem = "test_viewer")
   12. └─texPreview:::tex_preview.knitr_kable(...)
   13.   ├─texPreview::tex_preview(...)
   14.   └─texPreview:::tex_preview.character(...)
   15.     └─texPreview:::tex_preview.default(...)
   16.       └─texPreview:::tex_cleanup(cleanup, stem, keep_pdf, keep_log)
   17.         └─base::list.files(...)
  ── Error (test-viewer.R:36:5): shiny output: validate shiny output ─────────────
  Error in `if (file == "") file <- stdout() else if (startsWith(file, "|")) {
      file <- pipe(substring(file, 2L), "w")
      on.exit(close(file))
  } else {
      file <- file(file, ifelse(append, "a", "w"))
      on.exit(close(file))
  }`: argument is of length zero
  Backtrace:
       █
    1. ├─testthat::expect_null(...) test-viewer.R:36:4
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─`%>%`(...)
    5. ├─texPreview::tex_preview(., returnType = "shiny", stem = "test_shiny")
    6. └─texPreview:::tex_preview.knitr_kable(...)
    7.   ├─texPreview::tex_preview(...)
    8.   └─texPreview:::tex_preview.character(...)
    9.     └─texPreview:::tex_preview.default(...)
   10.       └─texPreview:::build_lines(obj, stem, tex_opts$get("usrPackages"))
   11.         └─base::cat(obj, file = tex_path(fileDir, stem), sep = "\n")
  ── Error (test-viewer.R:36:5): shiny output: validate shiny output ─────────────
  Error in `list.files(fileDir, sprintf("%s(.*?)(%s)", stem, paste0(cleanup, 
      collapse = "|")), full.names = TRUE)`: invalid 'path' argument
  Backtrace:
       █
    1. ├─testthat::expect_null(...) test-viewer.R:36:4
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─`%>%`(...)
    5. ├─texPreview::tex_preview(., returnType = "shiny", stem = "test_shiny")
    6. └─texPreview:::tex_preview.knitr_kable(...)
    7.   ├─texPreview::tex_preview(...)
    8.   └─texPreview:::tex_preview.character(...)
    9.     └─texPreview:::tex_preview.default(...)
   10.       └─texPreview:::tex_cleanup(cleanup, stem, keep_pdf, keep_log)
   11.         └─base::list.files(...)
  
  [ FAIL 12 | WARN 0 | SKIP 0 | PASS 18 ]
  Error: Test failures
  Execution halted