Running ‘testthat.R’ [12s/41s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(redist)
  Loading required package: redistmetrics
  
  Attaching package: 'redist'
  
  The following object is masked from 'package:stats':
  
      filter
  
  > 
  > test_check("redist")
  redist 4.0.0 fixes a bug where Schwartzberg was reporting 1/Schwartzberg. Current values are correct.
  This message is displayed once per session.
  An earlier bug incorrectly in redist doubled the number of removed edges. Current counts are correct.
  This message is displayed once per session.
  An earlier bug incorrectly in redist doubled the number of removed edges. Current counts are correct.
  This message is displayed once per session.
  
  -- redist_flip() ---------------------------------------------------------------
  
  -- Automated Redistricting Simulation Using Markov Chain Monte Carlo --
  
  i Preprocessing data.
  i Starting swMH().
  ===>---------------------------   10% | ETA:  0s | MH Acceptance: 1.00
  ==============================>  100% | ETA:  0s | MH Acceptance: 0.90
  
  
  -- redist_flip() ---------------------------------------------------------------
  
  -- Automated Redistricting Simulation Using Markov Chain Monte Carlo --
  
  i Preprocessing data.
  i Starting swMH().
  redist 4.0.0 aligned pro-Republican biases as positive numbers, reversing the old Efficiency Gap direction.
  This message is displayed once per session.
  redistmetrics 1.0.2 reverses tau gap direction. Positive is now pro-Republican bias.
  This message is displayed once per session.
  [1] "{"
  [1] "=="
  [1] "["
  A <redist_plans> containing 927 sampled plans
  Plans matrix: int [1:25, 1:927] 1 2 2 2 2 1 1 3 1 3 ...
  # A tibble: 2,781 x 3
     draw  district total_pop
   * <fct>    <int>     <dbl>
   1 1            1     54487
   2 1            2     58845
   3 1            3     61711
   4 2            1     59971
   5 2            2     58845
   6 2            3     56227
   7 3            1     58863
   8 3            2     59953
   9 3            3     56227
  10 4            1     58025
  # ... with 2,771 more rows
  Plans have 3 districts from a 25-unit map, and were drawn using Enumpart.
  Plans matrix: int [1:25, 1:927] 1 2 2 2 2 1 1 3 1 3 ...
  # A tibble: 2,781 x 3
     draw  district total_pop
   * <fct>    <int>     <dbl>
   1 1            1     54487
   2 1            2     58845
   3 1            3     61711
   4 2            1     59971
   5 2            2     58845
   6 2            3     56227
   7 3            1     58863
   8 3            2     59953
   9 3            3     56227
  10 4            1     58025
  # ... with 2,771 more rows
  [ FAIL 1 | WARN 0 | SKIP 2 | PASS 89 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (1)
  • On Linux (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_redist_map.R:15:5): constructor works with existing plan ────────
  Error in `nchar(xs)`: number of characters is not computable in "bytes" encoding, element 1
  Backtrace:
       ▆
    1. ├─testthat::expect_message(redist_map(iowa, existing_plan = cd_2010)) at test_redist_map.R:15:4
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─redist::redist_map(iowa, existing_plan = cd_2010)
    8.   └─cli::cli_inform("{.arg pop_tol} calculated from existing plan is ≤ 0.1%")
    9.     └─cli:::vcapply(message, format_inline, .envir = .envir)
   10.       └─base::vapply(X, FUN, FUN.VALUE = character(1), ..., USE.NAMES = USE.NAMES)
   11.         └─cli (local) FUN(X[[i]], ...)
   12.           └─cli:::fmt(cli_text(..., .envir = .envir))
   13.             └─cli:::cli__fmt(rec, collapse, strip_newline, app)
   14.               ├─base::do.call(app[[msg$type]], msg$args)
   15.               └─cli (local) `<fn>`(text = `<cl_gl_dl>`)
   16.                 └─cli:::clii_text(app, text)
   17.                   └─app$xtext(text)
   18.                     └─cli:::clii__xtext(...)
   19.                       └─cli::ansi_strwrap(text, exdent = exdent, width = app$get_width(extra = padding))
   20.                         └─base::lapply(pars, ansi_trimws)
   21.                           └─cli (local) FUN(X[[i]], ...)
  
  [ FAIL 1 | WARN 0 | SKIP 2 | PASS 89 ]
  Error: Test failures
  Execution halted