Running ‘testthat.R’ [3s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(haven)
  > 
  > test_check("haven")
  ── 1. Error: leaves factors unchanged (@test-as-factor.R#7)  ───────────────────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(f), f)
   4. forcats::as_factor(f)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 2. Error: converts characters to factors (@test-as-factor.R#11)  ────────────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(letters), factor(letters))
   4. forcats::as_factor(letters)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 3. Error: variable label is kept when converting characters to factors (#178)
  'where' must be an environment
  Backtrace:
   1. testthat::expect_identical(attr(as_factor(s1), "label"), "letters")
   4. forcats::as_factor(s1)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 4. Error: all labels (implicit missing values) are preserved when levels is '
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1), exp)
   4. forcats::as_factor(s1)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 5. Error: all labels (existing and missing) are sorted by values (#172) (@tes
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1), exp)
   4. forcats::as_factor(s1)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 6. Error: all values are preserved (@test-as-factor.R#39)  ──────────────────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1), exp)
   4. forcats::as_factor(s1)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 7. Error: character labelled converts to factor (@test-as-factor.R#45)  ─────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1), exp)
   4. forcats::as_factor(s1)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 8. Error: converts tagged NAs (@test-as-factor.R#51)  ───────────────────────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1), exp)
   4. forcats::as_factor(s1)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 9. Error: both combines values and levels (@test-as-factor.R#59)  ───────────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1, "both"), exp)
   4. forcats::as_factor(s1, "both")
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 10. Error: character labelled uses values when requested (@test-as-factor.R#6
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1, "values"), exp)
   4. forcats::as_factor(s1, "values")
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 11. Error: labels preserves all label values (@test-as-factor.R#74)  ────────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(...)
   4. forcats::as_factor(var, "labels")
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 12. Error: order of labels doesn't matter (@test-as-factor.R#79)  ───────────
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(...)
   4. forcats::as_factor(var, "labels")
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 13. Error: as_factor labels works with non-unique labels (@test-as-factor.R#8
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(as_factor(s1, "labels"), exp)
   4. forcats::as_factor(s1, "labels")
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 14. Error: variable label is kept when converting labelled to factor (#178) (
  'where' must be an environment
  Backtrace:
   1. testthat::expect_identical(attr(as_factor(s1), "label"), "labelled")
   4. forcats::as_factor(s1)
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 15. Error: ... passed along (@test-as-factor.R#100)  ────────────────────────
  'where' must be an environment
  Backtrace:
   1. forcats::as_factor(df, "both")
   2. ellipsis::check_dots_used()
   4. ellipsis:::exit_handler(action)
   5. base::bquote(...)
  
  ── 16. Error: can convert to factor with using labels with labelled na's (@test-
  'where' must be an environment
  Backtrace:
   1. testthat::expect_equal(...)
   4. forcats::as_factor(x, "labels")
   5. ellipsis::check_dots_used()
   7. ellipsis:::exit_handler(action)
   8. base::bquote(...)
  
  ── 17. Error: pillar (@test-pillar.R#4)  ───────────────────────────────────────
  'where' must be an environment
  Backtrace:
    1. testthat::expect_known_output(...)
    8. tibble:::print.tbl(...)
   12. tibble:::format.tbl(x, ..., n = n, width = width, n_extra = n_extra)
   14. tibble:::format.trunc_mat(mat)
   15. pillar::squeeze(x$mcf, width = width)
   16. pillar:::colonnade_get_width(x, width, rowid_width)
   17. pillar:::map(x[pillar_shown], pillar_shaft)
   18. base::lapply(.x, .f, ...)
   20. haven:::pillar_shaft.haven_labelled(X[[i]], ...)
   21. haven:::lbl_pillar_info(x)
   22. forcats::as_factor(x, "labels")
   23. ellipsis::check_dots_used()
   25. ellipsis:::exit_handler(action)
   26. base::bquote(...)
  
  ── 18. Error: supports stata version 15 (@test-write-dta.R#108)  ───────────────
  'where' must be an environment
  Backtrace:
   1. forcats::as_factor(df2$x)
   2. ellipsis::check_dots_used()
   4. ellipsis:::exit_handler(action)
   5. base::bquote(...)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 247 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 18 ]
  1. Error: leaves factors unchanged (@test-as-factor.R#7) 
  2. Error: converts characters to factors (@test-as-factor.R#11) 
  3. Error: variable label is kept when converting characters to factors (#178) (@test-as-factor.R#16) 
  4. Error: all labels (implicit missing values) are preserved when levels is 'default' or 'both' (#172) (@test-as-factor.R#24) 
  5. Error: all labels (existing and missing) are sorted by values (#172) (@test-as-factor.R#33) 
  6. Error: all values are preserved (@test-as-factor.R#39) 
  7. Error: character labelled converts to factor (@test-as-factor.R#45) 
  8. Error: converts tagged NAs (@test-as-factor.R#51) 
  9. Error: both combines values and levels (@test-as-factor.R#59) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted