Running 'testthat.R' [236s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(precommit)
  > test_check("precommit")
  [ FAIL 16 | WARN 0 | SKIP 5 | PASS 136 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (3)
  • not_conda() is TRUE (1)
  • on_cran() is TRUE (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-config.R:53:3): .Rbuildignore is written to the right directory when root is relative ──
  Error in `nchar(xs)`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
       ▆
    1. ├─withr::with_dir(fs::path_dir(root), use_precommit_config(root = fs::path_file(root))) at test-config.R:53:2
    2. │ └─base::force(code)
    3. └─precommit::use_precommit_config(root = fs::path_file(root))
    4.   └─cli::cli_ul(...)
    5.     └─cli:::cli__message(...)
    6.       └─cli:::cli__message_emit(cond)
    7.         ├─base::withRestarts(...)
    8.         │ └─base (local) withOneRestart(expr, restarts[[1L]])
    9.         │   └─base (local) doWithOneRestart(return(expr), restart)
   10.         └─cli:::cli__default_handler(cond)
   11.           └─cli:::cli_server_default(msg)
   12.             └─cli:::cli_server_default_safe(msg)
   13.               ├─base::do.call(app[[type]], msg$args)
   14.               └─cli (local) `<fn>`(items = `<list>`, id = "cli-24140-15", class = NULL, .close = TRUE)
   15.                 └─cli:::clii_ul(app, items, id, class, .close)
   16.                   └─app$li(items)
   17.                     └─cli:::clii_li(app, items, id, class)
   18.                       └─app$item_text(type, names(items)[i], cnt_id, items[[i]])
   19.                         └─cli:::clii__item_text(app, type, name, cnt_id, items, .list = .list)
   20.                           └─app$xtext(...)
   21.                             └─cli:::clii__xtext(...)
   22.                               └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   23.                                 └─base::lapply(pars, ansi_trimws)
   24.                                   └─cli (local) FUN(X[[i]], ...)
  ── Error (test-config.R:69:3): .Rbuildignore is written to the right directory when root is absolute ──
  Error in `nchar(xs)`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
       ▆
    1. └─precommit::use_precommit_config(root = root) at test-config.R:69:2
    2.   └─cli::cli_ul(...)
    3.     └─cli:::cli__message(...)
    4.       └─cli:::cli__message_emit(cond)
    5.         ├─base::withRestarts(...)
    6.         │ └─base (local) withOneRestart(expr, restarts[[1L]])
    7.         │   └─base (local) doWithOneRestart(return(expr), restart)
    8.         └─cli:::cli__default_handler(cond)
    9.           └─cli:::cli_server_default(msg)
   10.             └─cli:::cli_server_default_safe(msg)
   11.               ├─base::do.call(app[[type]], msg$args)
   12.               └─cli (local) `<fn>`(items = `<list>`, id = "cli-24140-22", class = NULL, .close = TRUE)
   13.                 └─cli:::clii_ul(app, items, id, class, .close)
   14.                   └─app$li(items)
   15.                     └─cli:::clii_li(app, items, id, class)
   16.                       └─app$item_text(type, names(items)[i], cnt_id, items[[i]])
   17.                         └─cli:::clii__item_text(app, type, name, cnt_id, items, .list = .list)
   18.                           └─app$xtext(...)
   19.                             └─cli:::clii__xtext(...)
   20.                               └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   21.                                 └─base::lapply(pars, ansi_trimws)
   22.                                   └─cli (local) FUN(X[[i]], ...)
  ── Error (test-hook-roxygenize.R:95:3): roxygenize works in general ────────────
  Error in `roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
      ▆
   1. ├─testthat::expect_message(...) at test-hook-roxygenize.R:95:2
   2. │ └─testthat:::quasi_capture(enquo(object), label, capture_messages)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─precommit::roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))
   7.   └─rlang::abort(conditionMessage(out))
  ── Failure (test-hook-roxygenize.R:126:3): fails gratefully when not installed package is called (packageNotFoundError) ──
  `roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))` threw an error with unexpected message.
  Expected match: "there is no package called"
  Actual message: "number of characters is not computable in \"bytes\" encoding, element 1"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-hook-roxygenize.R:126:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─precommit::roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))
   7.   └─rlang::abort(conditionMessage(out))
  ── Failure (test-hook-roxygenize.R:138:3): fails gratefully when not installed package is required according to `DESCRIPTION` ──
  `suppressWarnings(roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize")))` threw an error with unexpected message.
  Expected match: "The package .* is required"
  Actual message: "number of characters is not computable in \"bytes\" encoding, element 1"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-hook-roxygenize.R:138:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. ├─base::suppressWarnings(roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize")))
   7. │ └─base::withCallingHandlers(...)
   8. └─precommit::roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))
   9.   └─rlang::abort(conditionMessage(out))
  ── Failure (test-hook-roxygenize.R:152:3): fails when there is invalid code ────
  `roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))` threw an error with unexpected message.
  Expected match: "[Uu]nexpected symbol"
  Actual message: "number of characters is not computable in \"bytes\" encoding, element 1"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-hook-roxygenize.R:152:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─precommit::roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))
   7.   └─rlang::abort(conditionMessage(out))
  ── Error (test-hook-roxygenize.R:168:3): warns if there is any other warning ───
  Error in `roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test-hook-roxygenize.R:168:2
   2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─precommit::roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))
   7.   └─rlang::abort(conditionMessage(out))
  ── Failure (test-hooks.R:329:1): (code run outside of `test_that()`) ───────────
  in/flie.Rd and D:/temp/RtmpAFXZos/file95a84bb94084/man/flie.Rd are not supposed to be identical but they are
  Backtrace:
      ▆
   1. └─precommit:::run_test(...) at test-hooks.R:329:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit (local) .f(.x[[1L]], .y[[1L]], ...)
  ── Failure (test-hooks.R:349:1): (code run outside of `test_that()`) ───────────
  paste(contents, collapse = "\n") does not match "Please commit the new `.Rd` files".
  Actual value: "First time using roxygen2. Upgrading automatically...\nSetting `RoxygenNote` to "7.2.0"\nError in `precommit::roxygenize_with_cache()`:\n! number of characters is not computable in "bytes" encoding, element 1\nBacktrace:\n    ▆\n 1. └─precommit::roxygenize_with_cache(key = wd, dirs = path_relative_cache)\n 2.   └─rlang::abort(conditionMessage(out))\nExecution halted"
  Backtrace:
      ▆
   1. └─precommit:::run_test(...) at test-hooks.R:349:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit (local) .f(.x[[1L]], .y[[1L]], ...)
   6.           └─testthat::expect_match(...)
   7.             └─testthat:::expect_match_(...)
  ── Failure (test-hooks.R:365:1): (code run outside of `test_that()`) ───────────
  Expected: No error. Found:
  Setting `RoxygenNote` to "7.2.0"
  Error in `precommit::roxygenize_with_cache()`:
  ! number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
      ▆
   1. └─precommit::roxygenize_with_cache(key = wd, dirs = path_relative_cache)
   2.   └─rlang::abort(conditionMessage(out))
  Execution halted
  Backtrace:
      ▆
   1. └─precommit:::run_test(...) at test-hooks.R:365:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit (local) .f(.x[[1L]], .y[[1L]], ...)
  ── Failure (test-setup.R:12:3): snippet generation works ───────────────────────
  `out <- capture_output(snippet_generate("additional-deps-roxygenize"))` threw an error.
  Message: number of characters is not computable in "bytes" encoding, element 1
  Class:   simpleError/error/condition
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-setup.R:12:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─testthat::capture_output(snippet_generate("additional-deps-roxygenize"))
    7. │ └─testthat::capture_output_lines(code, print, width = width)
    8. │   └─testthat:::eval_with_output(code, print = print, width = width)
    9. │     ├─withr::with_output_sink(path, withVisible(code))
   10. │     │ └─base::force(code)
   11. │     └─base::withVisible(code)
   12. └─precommit::snippet_generate("additional-deps-roxygenize")
   13.   └─cli::cli_ul(...)
   14.     └─cli:::cli__message(...)
   15.       └─cli:::cli__message_emit(cond)
   16.         ├─base::withRestarts(...)
   17.         │ └─base (local) withOneRestart(expr, restarts[[1L]])
   18.         │   └─base (local) doWithOneRestart(return(expr), restart)
   19.         └─cli:::cli__default_handler(cond)
   20.           └─cli:::cli_server_default(msg)
   21.             └─cli:::cli_server_default_safe(msg)
   22.               ├─base::do.call(app[[type]], msg$args)
   23.               └─cli (local) `<fn>`(items = `<list>`, id = "cli-24140-86", class = NULL, .close = TRUE)
   24.                 └─cli:::clii_ul(app, items, id, class, .close)
   25.                   └─app$li(items)
   26.                     └─cli:::clii_li(app, items, id, class)
   27.                       └─app$item_text(type, names(items)[i], cnt_id, items[[i]])
   28.                         └─cli:::clii__item_text(app, type, name, cnt_id, items, .list = .list)
   29.                           └─app$xtext(...)
   30.                             └─cli:::clii__xtext(...)
   31.                               └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   32.                                 └─base::lapply(pars, ansi_trimws)
   33.                                   └─cli (local) FUN(X[[i]], ...)
  ── Failure (test-setup.R:17:3): snippet generation works ───────────────────────
  `out` does not match "    -   id: roxygenize\n.*        -    styler\n$".
  Actual value: ""
  Backtrace:
      ▆
   1. └─testthat::expect_match(...) at test-setup.R:17:2
   2.   └─testthat:::expect_match_(...)
  ── Error (test-setup.R:21:3): snippet generation works ─────────────────────────
  Error in `nchar(xs)`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-setup.R:21:2
    2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─testthat::capture_output(snippet_generate("additional-deps-roxygenize"))
    7. │ └─testthat::capture_output_lines(code, print, width = width)
    8. │   └─testthat:::eval_with_output(code, print = print, width = width)
    9. │     ├─withr::with_output_sink(path, withVisible(code))
   10. │     │ └─base::force(code)
   11. │     └─base::withVisible(code)
   12. └─precommit::snippet_generate("additional-deps-roxygenize")
   13.   └─cli::cli_ul(...)
   14.     └─cli:::cli__message(...)
   15.       └─cli:::cli__message_emit(cond)
   16.         ├─base::withRestarts(...)
   17.         │ └─base (local) withOneRestart(expr, restarts[[1L]])
   18.         │   └─base (local) doWithOneRestart(return(expr), restart)
   19.         └─cli:::cli__default_handler(cond)
   20.           └─cli:::cli_server_default(msg)
   21.             └─cli:::cli_server_default_safe(msg)
   22.               ├─base::do.call(app[[type]], msg$args)
   23.               └─cli (local) `<fn>`(items = `<list>`, id = "cli-24140-88", class = NULL, .close = TRUE)
   24.                 └─cli:::clii_ul(app, items, id, class, .close)
   25.                   └─app$li(items)
   26.                     └─cli:::clii_li(app, items, id, class)
   27.                       └─app$item_text(type, names(items)[i], cnt_id, items[[i]])
   28.                         └─cli:::clii__item_text(app, type, name, cnt_id, items, .list = .list)
   29.                           └─app$xtext(...)
   30.                             └─cli:::clii__xtext(...)
   31.                               └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   32.                                 └─base::lapply(pars, ansi_trimws)
   33.                                   └─cli (local) FUN(X[[i]], ...)
  ── Error (test-setup.R:37:3): snippet generation only includes hard dependencies ──
  Error in `nchar(xs)`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-setup.R:37:2
    2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─testthat::capture_output(snippet_generate("additional-deps-roxygenize"))
    7. │ └─testthat::capture_output_lines(code, print, width = width)
    8. │   └─testthat:::eval_with_output(code, print = print, width = width)
    9. │     ├─withr::with_output_sink(path, withVisible(code))
   10. │     │ └─base::force(code)
   11. │     └─base::withVisible(code)
   12. └─precommit::snippet_generate("additional-deps-roxygenize")
   13.   └─cli::cli_ul(...)
   14.     └─cli:::cli__message(...)
   15.       └─cli:::cli__message_emit(cond)
   16.         ├─base::withRestarts(...)
   17.         │ └─base (local) withOneRestart(expr, restarts[[1L]])
   18.         │   └─base (local) doWithOneRestart(return(expr), restart)
   19.         └─cli:::cli__default_handler(cond)
   20.           └─cli:::cli_server_default(msg)
   21.             └─cli:::cli_server_default_safe(msg)
   22.               ├─base::do.call(app[[type]], msg$args)
   23.               └─cli (local) `<fn>`(items = `<list>`, id = "cli-24140-90", class = NULL, .close = TRUE)
   24.                 └─cli:::clii_ul(app, items, id, class, .close)
   25.                   └─app$li(items)
   26.                     └─cli:::clii_li(app, items, id, class)
   27.                       └─app$item_text(type, names(items)[i], cnt_id, items[[i]])
   28.                         └─cli:::clii__item_text(app, type, name, cnt_id, items, .list = .list)
   29.                           └─app$xtext(...)
   30.                             └─cli:::clii__xtext(...)
   31.                               └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   32.                                 └─base::lapply(pars, ansi_trimws)
   33.                                   └─cli (local) FUN(X[[i]], ...)
  ── Error (test-setup.R:51:3): GitHub Action CI setup works ─────────────────────
  Error in `nchar(xs)`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
       ▆
    1. └─precommit::use_precommit_config(...) at test-setup.R:51:2
    2.   └─cli::cli_ul(...)
    3.     └─cli:::cli__message(...)
    4.       └─cli:::cli__message_emit(cond)
    5.         ├─base::withRestarts(...)
    6.         │ └─base (local) withOneRestart(expr, restarts[[1L]])
    7.         │   └─base (local) doWithOneRestart(return(expr), restart)
    8.         └─cli:::cli__default_handler(cond)
    9.           └─cli:::cli_server_default(msg)
   10.             └─cli:::cli_server_default_safe(msg)
   11.               ├─base::do.call(app[[type]], msg$args)
   12.               └─cli (local) `<fn>`(items = `<list>`, id = "cli-24140-97", class = NULL, .close = TRUE)
   13.                 └─cli:::clii_ul(app, items, id, class, .close)
   14.                   └─app$li(items)
   15.                     └─cli:::clii_li(app, items, id, class)
   16.                       └─app$item_text(type, names(items)[i], cnt_id, items[[i]])
   17.                         └─cli:::clii__item_text(app, type, name, cnt_id, items, .list = .list)
   18.                           └─app$xtext(...)
   19.                             └─cli:::clii__xtext(...)
   20.                               └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   21.                                 └─base::lapply(pars, ansi_trimws)
   22.                                   └─cli (local) FUN(X[[i]], ...)
  ── Error (test-setup.R:71:3): Pre-commit CI setup works ────────────────────────
  Error in `nchar(xs)`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
       ▆
    1. └─precommit::use_precommit_config(...) at test-setup.R:71:2
    2.   └─cli::cli_ul(...)
    3.     └─cli:::cli__message(...)
    4.       └─cli:::cli__message_emit(cond)
    5.         ├─base::withRestarts(...)
    6.         │ └─base (local) withOneRestart(expr, restarts[[1L]])
    7.         │   └─base (local) doWithOneRestart(return(expr), restart)
    8.         └─cli:::cli__default_handler(cond)
    9.           └─cli:::cli_server_default(msg)
   10.             └─cli:::cli_server_default_safe(msg)
   11.               ├─base::do.call(app[[type]], msg$args)
   12.               └─cli (local) `<fn>`(...)
   13.                 └─cli:::clii_ul(app, items, id, class, .close)
   14.                   └─app$li(items)
   15.                     └─cli:::clii_li(app, items, id, class)
   16.                       └─app$item_text(type, names(items)[i], cnt_id, items[[i]])
   17.                         └─cli:::clii__item_text(app, type, name, cnt_id, items, .list = .list)
   18.                           └─app$xtext(...)
   19.                             └─cli:::clii__xtext(...)
   20.                               └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   21.                                 └─base::lapply(pars, ansi_trimws)
   22.                                   └─cli (local) FUN(X[[i]], ...)
  
  [ FAIL 16 | WARN 0 | SKIP 5 | PASS 136 ]
  Error: Test failures
  Execution halted