Running ‘testthat.R’ [4s/6s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(dplyr)
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  > library(keyholder)
  
  Attaching package: 'keyholder'
  
  The following object is masked from 'package:stats':
  
      filter
  
  > 
  > test_check("keyholder")
  ── 1. Error: group_by_if works (@test-keyed-df-one-tbl.R#268)  ─────────────────
  Column `am` can't be modified because it's a grouping variable
  1: expect_commute_with_keys(mtcars_grouped, group_by_if_f) at testthat/test-keyed-df-one-tbl.R:268
  2: expect_commute(input = input, .f1 = .f, .f2 = assign_keys_mtcars, type = type) at testthat/test-keyed-df-one-tbl.R:27
  3: input %>% .f1 %>% .f2 at testthat/test-keyed-df-one-tbl.R:16
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: function_list[[i]](value)
  10: .f1(.)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: group_by_if(., is.double, as.integer)
  15: group_by(.tbl, !!!funs, add = .add)
  16: group_by.data.frame(.tbl, !!!funs, add = .add)
  17: group_by_prepare(.data, ..., add = add)
  18: add_computed_columns(.data, new_groups)
  19: mutate(.data, !!!mutate_vars)
  20: mutate.tbl_df(.data, !!!mutate_vars)
  21: mutate_impl(.data, dots)
  
  ── 2. Error: distinct works (@test-keyed-df-one-tbl.R#298)  ────────────────────
  Keys object should have the same number of rows as data.
  1: expect_false(mtcars_df %>% key_by(vs, am) %>% distinct(hp) %>% is_keyed_df()) at testthat/test-keyed-df-one-tbl.R:298
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: mtcars_df %>% key_by(vs, am) %>% distinct(hp) %>% is_keyed_df()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: distinct(., hp)
  12: distinct.keyed_df(., hp)
  13: unkey(NextMethod())
  14: NextMethod()
  15: distinct.data.frame(., hp)
  16: distinct_vars(.data, quos(...), .keep_all = .keep_all)
  17: list_cols_warning(.data, out_vars)
  18: df[keep_cols]
  19: `[.keyed_df`(df, keep_cols)
  20: `keys<-`(`*tmp*`, value = keys(x)[i, , drop = FALSE])
  21: stop("Keys object should have the same number of rows as data.")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 306 SKIPPED: 0 FAILED: 2
  1. Error: group_by_if works (@test-keyed-df-one-tbl.R#268) 
  2. Error: distinct works (@test-keyed-df-one-tbl.R#298) 
  
  Error: testthat unit tests failed
  Execution halted