Running ‘testthat.R’ [4s/35s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(naptime)
  > library(lubridate)
  
  Attaching package: 'lubridate'
  
  The following object is masked from 'package:base':
  
      date
  
  > 
  > test_check("naptime")
  ── 1. Error: character date handling: yyyy-mm-dd hh:mm:ss in past (@test-naptime
  Invalid timezone of input vector: ""
  1: expect_warning(neg_period_test <- system.time(naptime(as.character(lubridate::now() + 
         lubridate::seconds(-1))))[["elapsed"]]) at testthat/test-naptime.R:126
  2: quasi_capture(enquo(object), capture_warnings, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: system.time(naptime(as.character(lubridate::now() + lubridate::seconds(-1))))
  7: naptime(as.character(lubridate::now() + lubridate::seconds(-1)))
  8: lubridate::now() + lubridate::seconds(-1)
  9: lubridate::now() + lubridate::seconds(-1)
  10: add_period_to_date(e2, e1)
  11: update(lt, days = mday(lt) + per@day, hours = hour(lt) + per@hour, minutes = minute(lt) + 
         per@minute, seconds = second(lt) + per@.Data)
  12: update.POSIXt(lt, days = mday(lt) + per@day, hours = hour(lt) + per@hour, minutes = minute(lt) + 
         per@minute, seconds = second(lt) + per@.Data)
  13: do.call(update_date_time, c(list(object, roll = roll, week_start = week_start), list(...)))
  14: (function (object, years = integer(), months = integer(), days = integer(), mdays = integer(), 
         ydays = integer(), wdays = integer(), hours = integer(), minutes = integer(), 
         seconds = double(), tzs = NULL, roll = FALSE, week_start = 7) 
     {
         if (!length(object)) 
             return(object)
         if (length(days) > 0) 
             mdays = days
         updates <- list(year = years, month = months, yday = ydays, mday = mdays, wday = wdays, 
             hour = hours, minute = minutes, second = seconds)
         maxlen <- max(unlist(lapply(updates, length)))
         if (maxlen > 1) {
             for (nm in names(updates)) {
                 len <- length(updates[[nm]])
                 if (len != maxlen && len > 1) 
                     updates[[nm]] <- rep_len(updates[[nm]], maxlen)
             }
         }
         if (is.null(tzs)) 
             tzs <- tz(object)
         updates[["dt"]] <- as.POSIXct(object)
         updates[["roll"]] <- roll
         updates[["tz"]] <- tzs
         updates[["week_start"]] <- week_start
         reclass_date(do.call(C_update_dt, updates), object)
     })(structure(list(sec = 55.574963092804, min = 0L, hour = 9L, mday = 31L, mon = 2, 
         year = 118L, wday = 6L, yday = 89L, isdst = 1L, zone = "CEST", gmtoff = 7200L), .Names = c("sec", 
     "min", "hour", "mday", "mon", "year", "wday", "yday", "isdst", "zone", "gmtoff"), class = c("POSIXlt", 
     "POSIXt"), tzone = c("", "CET", "CEST")), roll = FALSE, week_start = 7, days = 31, 
         hours = 9, minutes = 0, seconds = 54.574963092804)
  15: reclass_date(do.call(C_update_dt, updates), object)
  16: reclass_date.POSIXlt(do.call(C_update_dt, updates), object)
  17: as.POSIXlt(new)
  18: do.call(C_update_dt, updates)
  19: (function (dt, year, month, yday, mday, wday, hour, minute, second, tz = NULL, roll = FALSE, 
         week_start = 7L) 
     {
         .Call(`_lubridate_C_update_dt`, dt, year, month, yday, mday, wday, hour, minute, 
             second, tz, roll, week_start)
     })(year = integer(0), month = integer(0), yday = integer(0), mday = 31, wday = integer(0), 
         hour = 9, minute = 0, second = 54.574963092804, dt = structure(1522479655.57496, class = c("POSIXct", 
         "POSIXt"), tzone = ""), roll = FALSE, tz = "", week_start = 7)
  
  ── 2. Error: character date handling: yyyy-mm-dd hh:mm:ss in future (@test-napti
  Invalid timezone of input vector: ""
  1: system.time(naptime(as.character(lubridate::now() + lubridate::seconds(5)))) at testthat/test-naptime.R:136
  2: naptime(as.character(lubridate::now() + lubridate::seconds(5)))
  3: lubridate::now() + lubridate::seconds(5)
  4: lubridate::now() + lubridate::seconds(5)
  5: add_period_to_date(e2, e1)
  6: update(lt, days = mday(lt) + per@day, hours = hour(lt) + per@hour, minutes = minute(lt) + 
         per@minute, seconds = second(lt) + per@.Data)
  7: update.POSIXt(lt, days = mday(lt) + per@day, hours = hour(lt) + per@hour, minutes = minute(lt) + 
         per@minute, seconds = second(lt) + per@.Data)
  8: do.call(update_date_time, c(list(object, roll = roll, week_start = week_start), list(...)))
  9: (function (object, years = integer(), months = integer(), days = integer(), mdays = integer(), 
         ydays = integer(), wdays = integer(), hours = integer(), minutes = integer(), 
         seconds = double(), tzs = NULL, roll = FALSE, week_start = 7) 
     {
         if (!length(object)) 
             return(object)
         if (length(days) > 0) 
             mdays = days
         updates <- list(year = years, month = months, yday = ydays, mday = mdays, wday = wdays, 
             hour = hours, minute = minutes, second = seconds)
         maxlen <- max(unlist(lapply(updates, length)))
         if (maxlen > 1) {
             for (nm in names(updates)) {
                 len <- length(updates[[nm]])
                 if (len != maxlen && len > 1) 
                     updates[[nm]] <- rep_len(updates[[nm]], maxlen)
             }
         }
         if (is.null(tzs)) 
             tzs <- tz(object)
         updates[["dt"]] <- as.POSIXct(object)
         updates[["roll"]] <- roll
         updates[["tz"]] <- tzs
         updates[["week_start"]] <- week_start
         reclass_date(do.call(C_update_dt, updates), object)
     })(structure(list(sec = 56.1707229614258, min = 0L, hour = 9L, mday = 31L, mon = 2, 
         year = 118L, wday = 6L, yday = 89L, isdst = 1L, zone = "CEST", gmtoff = 7200L), .Names = c("sec", 
     "min", "hour", "mday", "mon", "year", "wday", "yday", "isdst", "zone", "gmtoff"), class = c("POSIXlt", 
     "POSIXt"), tzone = c("", "CET", "CEST")), roll = FALSE, week_start = 7, days = 31, 
         hours = 9, minutes = 0, seconds = 61.1707229614258)
  10: reclass_date(do.call(C_update_dt, updates), object)
  11: reclass_date.POSIXlt(do.call(C_update_dt, updates), object)
  12: as.POSIXlt(new)
  13: do.call(C_update_dt, updates)
  14: (function (dt, year, month, yday, mday, wday, hour, minute, second, tz = NULL, roll = FALSE, 
         week_start = 7L) 
     {
         .Call(`_lubridate_C_update_dt`, dt, year, month, yday, mday, wday, hour, minute, 
             second, tz, roll, week_start)
     })(year = integer(0), month = integer(0), yday = integer(0), mday = 31, wday = integer(0), 
         hour = 9, minute = 0, second = 61.1707229614258, dt = structure(1522479656.17072, class = c("POSIXct", 
         "POSIXt"), tzone = ""), roll = FALSE, tz = "", week_start = 7)
  
  ── 3. Error: Invalid Period throws error (@test-naptime.R#168)  ────────────────
  Invalid timezone of input vector: ""
  1: difftime(now() + seconds(2), now()) at testthat/test-naptime.R:168
  2: as.POSIXct(time1)
  3: now() + seconds(2)
  4: now() + seconds(2)
  5: add_period_to_date(e2, e1)
  6: update(lt, days = mday(lt) + per@day, hours = hour(lt) + per@hour, minutes = minute(lt) + 
         per@minute, seconds = second(lt) + per@.Data)
  7: update.POSIXt(lt, days = mday(lt) + per@day, hours = hour(lt) + per@hour, minutes = minute(lt) + 
         per@minute, seconds = second(lt) + per@.Data)
  8: do.call(update_date_time, c(list(object, roll = roll, week_start = week_start), list(...)))
  9: (function (object, years = integer(), months = integer(), days = integer(), mdays = integer(), 
         ydays = integer(), wdays = integer(), hours = integer(), minutes = integer(), 
         seconds = double(), tzs = NULL, roll = FALSE, week_start = 7) 
     {
         if (!length(object)) 
             return(object)
         if (length(days) > 0) 
             mdays = days
         updates <- list(year = years, month = months, yday = ydays, mday = mdays, wday = wdays, 
             hour = hours, minute = minutes, second = seconds)
         maxlen <- max(unlist(lapply(updates, length)))
         if (maxlen > 1) {
             for (nm in names(updates)) {
                 len <- length(updates[[nm]])
                 if (len != maxlen && len > 1) 
                     updates[[nm]] <- rep_len(updates[[nm]], maxlen)
             }
         }
         if (is.null(tzs)) 
             tzs <- tz(object)
         updates[["dt"]] <- as.POSIXct(object)
         updates[["roll"]] <- roll
         updates[["tz"]] <- tzs
         updates[["week_start"]] <- week_start
         reclass_date(do.call(C_update_dt, updates), object)
     })(structure(list(sec = 56.9775826931, min = 0L, hour = 9L, mday = 31L, mon = 2, 
         year = 118L, wday = 6L, yday = 89L, isdst = 1L, zone = "CEST", gmtoff = 7200L), .Names = c("sec", 
     "min", "hour", "mday", "mon", "year", "wday", "yday", "isdst", "zone", "gmtoff"), class = c("POSIXlt", 
     "POSIXt"), tzone = c("", "CET", "CEST")), roll = FALSE, week_start = 7, days = 31, 
         hours = 9, minutes = 0, seconds = 58.9775826931)
  10: reclass_date(do.call(C_update_dt, updates), object)
  11: reclass_date.POSIXlt(do.call(C_update_dt, updates), object)
  12: as.POSIXlt(new)
  13: do.call(C_update_dt, updates)
  14: (function (dt, year, month, yday, mday, wday, hour, minute, second, tz = NULL, roll = FALSE, 
         week_start = 7L) 
     {
         .Call(`_lubridate_C_update_dt`, dt, year, month, yday, mday, wday, hour, minute, 
             second, tz, roll, week_start)
     })(year = integer(0), month = integer(0), yday = integer(0), mday = 31, wday = integer(0), 
         hour = 9, minute = 0, second = 58.9775826931, dt = structure(1522479656.97758, class = c("POSIXct", 
         "POSIXt"), tzone = ""), roll = FALSE, tz = "", week_start = 7)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 67 SKIPPED: 0 FAILED: 3
  1. Error: character date handling: yyyy-mm-dd hh:mm:ss in past (@test-naptime.R#126) 
  2. Error: character date handling: yyyy-mm-dd hh:mm:ss in future (@test-naptime.R#136) 
  3. Error: Invalid Period throws error (@test-naptime.R#168) 
  
  Error: testthat unit tests failed
  Execution halted