Running 'testthat.R'
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(precommit)
  > test_check("precommit")
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (2)
  • env not supported in system2 on Windows (2)
  • not_conda() is TRUE (1)
  • on_cran() is TRUE (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-hook-roxygenize.R:2:3): roxygen runs are done if necessary ────
  extract_diff_root(".") not equal to add_trailing_linebreak(text2).
  5/5 mismatches
  x[1]: "if (x) {\r\n"
  y[1]: "if (x) {\n"
  
  x[2]: " TRUE\r\n"
  y[2]: " TRUE\n"
  
  x[3]: "} else {\r\n"
  y[3]: "} else {\n"
  
  x[4]: "  not_TRue(sinux(-i))\r\n"
  y[4]: "  not_TRue(sinux(-i))\n"
  
  x[5]: "}\r\n"
  y[5]: "}\n"
  Backtrace:
      █
   1. ├─withr::with_tempdir(...) test-hook-roxygenize.R:2:2
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. └─testthat::expect_equal(extract_diff_root("."), add_trailing_linebreak(text2)) test-hook-roxygenize.R:25:4
  ── Failure (test-hook-roxygenize.R:54:3): change in formals alone triggers invalidation ──
  extract_diff_root(".") not equal to add_trailing_linebreak(c("x <- function(a = 2) {", "x <- function(a = 3) {")).
  2/2 mismatches
  x[1]: "x <- function(a = 2) {\r\n"
  y[1]: "x <- function(a = 2) {\n"
  
  x[2]: "x <- function(a = 3) {\r\n"
  y[2]: "x <- function(a = 3) {\n"
  Backtrace:
      █
   1. ├─withr::with_tempdir(...) test-hook-roxygenize.R:54:2
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. └─testthat::expect_equal(...) test-hook-roxygenize.R:72:4
  ── Failure (test-hooks.R:251:1): (code run outside of `test_that()`) ───────────
  Expected: No error. Found:
  Error in system2("git", "status", stdout = TRUE) : '"git"' not found
  Calls: grepl -> is.factor -> system2
  Execution halted
  Backtrace:
      █
   1. └─precommit:::run_test("lintr", suffix = "-success.R", error_msg = NULL) test-hooks.R:251:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit:::.f(.x[[1L]], .y[[1L]], ...)
  ── Failure (test-hooks.R:257:1): (code run outside of `test_that()`) ───────────
  paste(contents, collapse = "\n") does not match "not lint free".
  Actual value: "Error in system2("git", "status", stdout = TRUE) : '"git"' not found\nCalls: grepl -> is.factor -> system2\nExecution halted"
  Backtrace:
      █
   1. └─precommit:::run_test("lintr", suffix = "-fail.R", error_msg = "not lint free") test-hooks.R:257:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit:::.f(.x[[1L]], .y[[1L]], ...)
   6.           └─testthat::expect_match(...)
   7.             └─testthat:::expect_match_(...)
  ── Failure (test-hooks.R:260:1): (code run outside of `test_that()`) ───────────
  Expected: No error. Found:
  Error in system2("git", "status", stdout = TRUE) : '"git"' not found
  Calls: grepl -> is.factor -> system2
  Execution halted
  Backtrace:
      █
   1. └─precommit:::run_test(...) test-hooks.R:260:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit:::.f(.x[[1L]], .y[[1L]], ...)
  ── Failure (test-hooks.R:285:1): (code run outside of `test_that()`) ───────────
  Expected: No error. Found:
  Error in system2("git", c("diff --cached --name-only"), stdout = TRUE) : 
    '"git"' not found
  Execution halted
  Backtrace:
      █
   1. └─precommit:::run_test(...) test-hooks.R:285:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit:::.f(.x[[i]], .y[[i]], ...)
  ── Failure (test-hooks.R:285:1): (code run outside of `test_that()`) ───────────
  Expected: No error. Found:
  Error in system2("git", c("diff --cached --name-only"), stdout = TRUE) : 
    '"git"' not found
  Execution halted
  Backtrace:
      █
   1. └─precommit:::run_test(...) test-hooks.R:285:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit:::.f(.x[[i]], .y[[i]], ...)
  ── Failure (test-hooks.R:323:1): (code run outside of `test_that()`) ───────────
  paste(contents, collapse = "\n") does not match "should be both staged".
  Actual value: "Error in system2("git", c("diff --cached --name-only"), stdout = TRUE) : \n  '"git"' not found\nExecution halted"
  Backtrace:
      █
   1. └─precommit:::run_test(...) test-hooks.R:323:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit:::.f(.x[[i]], .y[[i]], ...)
   6.           └─testthat::expect_match(...)
   7.             └─testthat:::expect_match_(...)
  ── Failure (test-hooks.R:323:1): (code run outside of `test_that()`) ───────────
  paste(contents, collapse = "\n") does not match "should be both staged".
  Actual value: "Error in system2("git", c("diff --cached --name-only"), stdout = TRUE) : \n  '"git"' not found\nExecution halted"
  Backtrace:
      █
   1. └─precommit:::run_test(...) test-hooks.R:323:0
   2.   └─precommit:::run_test_impl(...)
   3.     └─precommit:::hook_state_assert(...)
   4.       └─purrr::map2(...)
   5.         └─precommit:::.f(.x[[i]], .y[[i]], ...)
   6.           └─testthat::expect_match(...)
   7.             └─testthat:::expect_match_(...)
  
  [ FAIL 9 | WARN 0 | SKIP 6 | PASS 122 ]
  Error: Test failures
  Execution halted