Running ‘testthat.R’ [7s/18s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(prt)
  > 
  > if (requireNamespace("xml2")) {
  +   test_check("prt", reporter = MultiReporter$new(reporters = list(JunitReporter$new(file = "test-results.xml"), CheckReporter$new())))
  + } else {
  +   test_check("prt")
  + }
  Loading required namespace: xml2
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-format.R:20:3): print() returns output invisibly ────────────────
  Error: subscript out of bounds
  Backtrace:
       █
    1. ├─testthat::expect_output(ret <- withVisible(print(prt_cars))) test-format.R:20:2
    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. ├─base::withVisible(print(prt_cars))
   11. ├─base::print(prt_cars)
   12. └─prt:::print.prt(prt_cars)
   13.   ├─prt:::cat_line(format(x, ..., n = n, width = width, n_extra = n_extra))
   14.   │ ├─base::trimws(paste0(...), "right")
   15.   │ │ └─base:::mysub(paste0(whitespace, "+$"), x)
   16.   │ │   └─base::sub(re, "", x, perl = TRUE)
   17.   │ └─base::paste0(...)
   18.   ├─base::format(x, ..., n = n, width = width, n_extra = n_extra)
   19.   └─prt:::format.prt(x, ..., n = n, width = width, n_extra = n_extra)
   20.     ├─base::format(trunc_dt(x, n = n, width = width, n_extra = n_extra))
   21.     └─prt:::format.trunc_dt(trunc_dt(x, n = n, width = width, n_extra = n_extra))
   22.       └─prt:::squeeze_dt(x, width = width)
   23.         └─prt:::add_empty_row(res)
  ── Error (test-format.R:29:3): trunc_dt output matches known output ────────────
  Error: subscript out of bounds
  Backtrace:
       █
    1. ├─prt:::expect_output_file_opts(...) test-format.R:29:2
    2. │ ├─withr::with_options(...) helper-functions.R:5:2
    3. │ │ └─base::force(code)
    4. │ └─testthat::expect_known_output(x, output_file(filename), update = FALSE)
    5. │   ├─base::append(act, eval_with_output(object, print = print, width = width))
    6. │   └─testthat:::eval_with_output(object, print = print, width = width)
    7. │     ├─withr::with_output_sink(temp, withVisible(code))
    8. │     │ └─base::force(code)
    9. │     └─base::withVisible(code)
   10. ├─base::print(prt_cars, n = 8L, width = 30L)
   11. └─prt:::print.prt(prt_cars, n = 8L, width = 30L)
   12.   ├─prt:::cat_line(format(x, ..., n = n, width = width, n_extra = n_extra))
   13.   │ ├─base::trimws(paste0(...), "right")
   14.   │ │ └─base:::mysub(paste0(whitespace, "+$"), x)
   15.   │ │   └─base::sub(re, "", x, perl = TRUE)
   16.   │ └─base::paste0(...)
   17.   ├─base::format(x, ..., n = n, width = width, n_extra = n_extra)
   18.   └─prt:::format.prt(x, ..., n = n, width = width, n_extra = n_extra)
   19.     ├─base::format(trunc_dt(x, n = n, width = width, n_extra = n_extra))
   20.     └─prt:::format.trunc_dt(trunc_dt(x, n = n, width = width, n_extra = n_extra))
   21.       └─prt:::squeeze_dt(x, width = width)
   22.         └─prt:::add_empty_row(res)
  ── Failure (test-format.R:103:3): trunc_mat for POSIXct columns ────────────────
  Results have changed from known value recorded in 'output/format/POSIXct-8-60.txt'.
  
  old vs new
    "# A prt:        12 × 1"
    "# Partitioning: [12] rows"
  - "   x"
  + "list(capital_format = c(\"  \", \"  \"), shaft_format = c(\"1 \", \"2 \", \"3 \", \"4 \", \"5 \", \"6 \", \"7 \", \"8 \", \"9 \", \"10\", \"11\", \"12\"))"
  - "   <dttm>"
  + "x"
  - "1  2016-01-01 12:34:57"
  + "<dttm>"
  - "2  2016-01-01 12:34:58"
  + "2016-01-01 12:34:57"
  and 7 more ...
  Backtrace:
      █
   1. └─prt:::expect_output_file_opts(...) test-format.R:103:2
   2.   ├─withr::with_options(...) helper-functions.R:5:2
   3.   │ └─base::force(code)
   4.   └─testthat::expect_known_output(x, output_file(filename), update = FALSE)
  ── Failure (test-format.R:117:3): trunc_mat for wide-character columns ─────────
  Results have changed from known value recorded in 'output/format/wide-8-60.txt'.
  
  old vs new
    "# A prt:        3 × 2"
    "# Partitioning: [3] rows"
  - "  成交日期 合同录入日期"
  + "list(capital_format = c(\" \", \" \"), shaft_format = c(\"1\", \"2\", \"3\"))"
  - "     <int>        <int>"
  + "成交日期 合同录入日期"
  - "1        1            4"
  + "   <int>        <int>"
  - "2        2            5"
  + "       1            4"
  - "3        3            6"
  + "       2            5"
  + "       3            6"
  Backtrace:
      █
   1. └─prt:::expect_output_file_opts(...) test-format.R:117:2
   2.   ├─withr::with_options(...) helper-functions.R:5:2
   3.   │ └─base::force(code)
   4.   └─testthat::expect_known_output(x, output_file(filename), update = FALSE)
  
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 257 ]
  Error: Test failures
  Execution halted