Running ‘testthat.R’ [56s/61s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Sys.setenv("R_TESTS" = "")
  > library(testthat)
  > library(collapse)
  collapse 1.2.1, see ?`collapse-package` or ?`collapse-documentation`
  
  Attaching package: 'collapse'
  
  The following object is masked from 'package:stats':
  
      D
  
  > 
  > test_check("collapse")
  
   *** caught segfault ***
  address 0x55cb3d781ff8, cause 'memory not mapped'
  
  Traceback:
   1: fsum.default(w, x)
   2: (function (x, w, na.rm = FALSE) {    ax <- attributes(x)    if (na.rm) {        cc <- complete.cases(x, w)        w <- w[cc]        x <- x[cc]    }    sw <- fsum.default(w, x)    max <- which.max(sw)    res <- names(sw)[max]    storage.mode(res) <- storage.mode(x)    `attributes<-`(res, ax)})(dots[[1L]][[4L]], dots[[2L]][[4L]], na.rm = dots[[3L]][[1L]])
   3: mapply(weighted.Mode, split(x, f), split(wNA, f), na.rm = TRUE)
   4: eval_bare(expr, quo_get_env(quo))
   5: quasi_label(enquo(expected), expected.label, arg = "expected")
   6: expect_equal(fmode(x, f, wNA), mapply(weighted.Mode, split(x,     f), split(wNA, f), na.rm = TRUE))
   7: eval(code, test_env)
   8: eval(code, test_env)
   9: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  10: doTryCatch(return(expr), name, parentenv, handler)
  11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  13: doTryCatch(return(expr), name, parentenv, handler)
  14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  15: tryCatchList(expr, classes, parentenv, handlers)
  16: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  17: test_code(desc, code, env = parent.frame())
  18: test_that("fmode with weights performs like weighted.Mode (defined above)",     {        expect_equal(fmode(1, w = 1), weighted.Mode(1, w = 1))        expect_equal(fmode(1:3, w = 1:3), weighted.Mode(1:3,             1:3))        expect_equal(fmode(-1:1, w = 1:3), weighted.Mode(-1:1,             1:3))        expect_equal(fmode(1, w = 1, na.rm = FALSE), weighted.Mode(1,             1))        expect_equal(fmode(1:3, w = c(0.99, 3454, 1.111), na.rm = FALSE),             weighted.Mode(1:3, c(0.99, 3454, 1.111)))        expect_equal(fmode(-1:1, w = 1:3, na.rm = FALSE), weighted.Mode(-1:1,             1:3))        expect_equal(fmode(x, w = w), weighted.Mode(x, w))        expect_equal(fmode(x, w = w, na.rm = FALSE), weighted.Mode(x,             w))        expect_equal(fmode(xNA, w = w, na.rm = FALSE), weighted.Mode(xNA,             w))        expect_equal(fmode(xNA, w = w), weighted.Mode(xNA, w,             na.rm = TRUE))        expect_equal(fmode(m, w = wdat), dapply(m, weighted.Mode,             wdat, na.rm = TRUE))        expect_equal(fmode(m, w = wdat, na.rm = FALSE), dapply(m,             weighted.Mode, wdat))        expect_equal(fmode(mNA, w = wdat, na.rm = FALSE), dapply(mNA,             weighted.Mode, wdat))        expect_equal(fmode(mNA, w = wdat), dapply(mNA, weighted.Mode,             wdat, na.rm = TRUE))        expect_equal(fmode(x, f, w), mapply(weighted.Mode, split(x,             f), split(w, f)))        expect_equal(fmode(x, f, w, na.rm = FALSE), mapply(weighted.Mode,             split(x, f), split(w, f)))        expect_equal(fmode(xNA, f, w, na.rm = FALSE), mapply(weighted.Mode,             split(xNA, f), split(w, f)))        expect_equal(fmode(xNA, f, w), mapply(weighted.Mode,             split(xNA, f), split(w, f), na.rm = TRUE))        expect_equal(fmode(1:3, w = c(NA, 1:2)), weighted.Mode(1:3,             c(NA, 1:2), na.rm = TRUE))        expect_equal(fmode(-1:1, w = c(NA, 1:2)), weighted.Mode(-1:1,             c(NA, 1:2), na.rm = TRUE))        expect_equal(fmode(1:3, w = c(NA, 1:2), na.rm = FALSE),             weighted.Mode(1:3, c(NA, 1:2)))        expect_equal(fmode(-1:1, w = c(NA, 1:2), na.rm = FALSE),             weighted.Mode(-1:1, c(NA, 1:2)))        expect_equal(fmode(x, w = wNA), weighted.Mode(x, wNA,             na.rm = TRUE))        expect_equal(fmode(x, w = wNA, na.rm = FALSE), weighted.Mode(x,             wNA))        expect_equal(fmode(xNA, w = wNA), weighted.Mode(xNA,             wNA, na.rm = TRUE))        expect_equal(fmode(m, w = wdatNA), dapply(m, weighted.Mode,             wdatNA, na.rm = TRUE))        expect_equal(fmode(mNA, w = wdatNA), dapply(mNA, weighted.Mode,             wdatNA, na.rm = TRUE))        expect_equal(fmode(x, f, wNA), mapply(weighted.Mode,             split(x, f), split(wNA, f), na.rm = TRUE))        expect_equal(fmode(x, f, wNA, na.rm = FALSE), mapply(weighted.Mode,             split(x, f), split(wNA, f)))        expect_equal(fmode(xNA, f, wNA), mapply(weighted.Mode,             split(xNA, f), split(wNA, f), na.rm = TRUE))    })
  19: eval(code, test_env)
  20: eval(code, test_env)
  21: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  22: doTryCatch(return(expr), name, parentenv, handler)
  23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  25: doTryCatch(return(expr), name, parentenv, handler)
  26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  27: tryCatchList(expr, classes, parentenv, handlers)
  28: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  29: test_code(NULL, exprs, env)
  30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  31: force(code)
  32: doWithOneRestart(return(expr), restart)
  33: withOneRestart(expr, restarts[[1L]])
  34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        reporter$start_file(basename(path))        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        reporter$.end_context()        reporter$end_file()    })
  36: FUN(X[[i]], ...)
  37: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  38: force(code)
  39: doWithOneRestart(return(expr), restart)
  40: withOneRestart(expr, restarts[[1L]])
  41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  42: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  44: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  45: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  46: test_check("collapse")
  An irrecoverable exception occurred. R is aborting now ...
  Segmentation fault