Running 'testthat.R' [11s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(datastructures)
  Loading required package: Rcpp
  
  Attaching package: 'datastructures'
  
  The following objects are masked from 'package:utils':
  
      head, stack
  
  The following object is masked from 'package:base':
  
      get
  
  > library(testthat)
  > 
  > test_check("datastructures")
  -- 1. Error: map shows (@tests_map_bimap.R#32)  --------------------------------
  attempt to apply non-function
  1: expect_output(show(bimap("integer", "numeric"))) at testthat/tests_map_bimap.R:32
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: show(bimap("integer", "numeric"))
  11: bimap("integer", "numeric")
  12: methods::new(bimap_id)
  13: initialize(value, ...)
  14: (function (classes, fdef, mtable) 
     {
         methods <- .findInheritedMethods(classes, fdef, mtable)
         if (length(methods) == 1L) 
             return(methods[[1L]])
         else if (length(methods) == 0L) {
             cnames <- paste0("\"", vapply(classes, as.character, ""), "\"", collapse = ", ")
             stop(gettextf("unable to find an inherited method for function %s for signature %s", 
                 sQuote(fdef@generic), sQuote(cnames)), domain = NA)
         }
         else stop("Internal error in finding inherited methods; didn't return a unique method", 
             domain = NA)
     })(list(structure("Rcpp_bimap_id", package = "datastructures")), structure(function (.Object, 
         ...) 
     {
         value <- standardGeneric("initialize")
         if (!identical(class(value), class(.Object))) {
             cv <- class(value)
             co <- class(.Object)
             if (.identC(cv[[1L]], co)) {
                 if (is.na(match(cv, .BasicClasses)) && length(cv) == 1L) {
                     warning(gettextf("missing package slot (%s) in object of class %s (package info added)", 
                       packageSlot(co), dQuote(class(.Object))), domain = NA)
                     class(value) <- class(.Object)
                 }
                 else return(value)
             }
             else stop(gettextf("'initialize' method returned an object of class %s instead of the required class %s", 
                 paste(dQuote(class(value)), collapse = ", "), dQuote(class(.Object))), 
                 domain = NA)
         }
         value
     }, generic = structure("initialize", package = "methods"), package = "methods", group = list(), valueClass = character(0), signature = structure(".Object", simpleOnly = TRUE), default = structure(function (.Object, 
         ...) 
     {
         args <- list(...)
         if (length(args)) {
             Class <- class(.Object)
             if (!is.na(match(Class, .BasicClasses))) 
                 return(newBasic(Class, ...))
             ClassDef <- getClass(Class)
             snames <- allNames(args)
             which <- nzchar(snames)
             elements <- args[which]
             supers <- args[!which]
             thisExtends <- names(ClassDef@contains)
             slotDefs <- ClassDef@slots
             dataPart <- slotDefs[[".Data"]]
             if (is.null(dataPart)) 
                 dataPart <- "missing"
             if (length(supers)) {
                 for (i in rev(seq_along(supers))) {
                     obj <- supers[[i]]
                     Classi <- class(obj)
                     if (length(Classi) > 1L) 
                       Classi <- Classi[[1L]]
                     if (.identC(Classi, Class)) 
                       .Object <- obj
                     else if (extends(Classi, Class)) 
                       .Object <- as(obj, Class, strict = FALSE)
                     else if (extends(Class, Classi)) 
                       as(.Object, Classi) <- obj
                     else if (extends(Classi, dataPart)) 
                       .Object@.Data <- obj
                     else {
                       extendsi <- extends(Classi)[-1L]
                       which <- match(thisExtends, extendsi)
                       which <- seq_along(which)[!is.na(which)]
                       if (length(which)) {
                         Classi <- thisExtends[which[1L]]
                         as(.Object, Classi) <- obj
                       }
                       else stop(gettextf("cannot use object of class %s in new():  class %s does not extend that class", 
                         dQuote(Classi), dQuote(Class)), domain = NA)
                     }
                 }
             }
             if (length(elements)) {
                 snames <- names(elements)
                 if (anyDuplicated(snames)) 
                     stop(gettextf("duplicated slot names: %s", paste(sQuote(snames[duplicated(snames)]), 
                       collapse = ", ")), domain = NA)
                 which <- match(snames, names(slotDefs))
                 if (anyNA(which)) 
                     stop(sprintf(ngettext(sum(is.na(which)), "invalid name for slot of class %s: %s", 
                       "invalid names for slots of class %s: %s"), dQuote(Class), paste(snames[is.na(which)], 
                       collapse = ", ")), domain = NA)
                 firstTime <- TRUE
                 for (i in seq_along(snames)) {
                     slotName <- snames[[i]]
                     slotClass <- slotDefs[[slotName]]
                     slotClassDef <- getClassDef(slotClass, package = ClassDef@package)
                     slotVal <- elements[[i]]
                     if (!.identC(class(slotVal), slotClass) && !is.null(slotClassDef)) {
                       valClass <- class(slotVal)
                       valClassDef <- getClassDef(valClass, package = ClassDef@package)
                       if (!identical(possibleExtends(valClass, slotClass, valClassDef, 
                         slotClassDef), FALSE)) 
                         slotVal <- as(slotVal, slotClass, strict = FALSE)
                     }
                     if (firstTime) {
                       slot(.Object, slotName, check = FALSE) <- slotVal
                       firstTime <- FALSE
                     }
                     else {
                       `slot<-`(.Object, slotName, check = FALSE, slotVal)
                     }
                 }
             }
             validObject(.Object)
         }
         .Object
     }, target = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), defined = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), generic = structure("initialize", package = "methods"), class = structure("derivedDefaultMethod", package = "methods")), skeleton = (structure(function (.Object, 
         ...) 
     {
         args <- list(...)
         if (length(args)) {
             Class <- class(.Object)
             if (!is.na(match(Class, .BasicClasses))) 
                 return(newBasic(Class, ...))
             ClassDef <- getClass(Class)
             snames <- allNames(args)
             which <- nzchar(snames)
             elements <- args[which]
             supers <- args[!which]
             thisExtends <- names(ClassDef@contains)
             slotDefs <- ClassDef@slots
             dataPart <- slotDefs[[".Data"]]
             if (is.null(dataPart)) 
                 dataPart <- "missing"
             if (length(supers)) {
                 for (i in rev(seq_along(supers))) {
                     obj <- supers[[i]]
                     Classi <- class(obj)
                     if (length(Classi) > 1L) 
                       Classi <- Classi[[1L]]
                     if (.identC(Classi, Class)) 
                       .Object <- obj
                     else if (extends(Classi, Class)) 
                       .Object <- as(obj, Class, strict = FALSE)
                     else if (extends(Class, Classi)) 
                       as(.Object, Classi) <- obj
                     else if (extends(Classi, dataPart)) 
                       .Object@.Data <- obj
                     else {
                       extendsi <- extends(Classi)[-1L]
                       which <- match(thisExtends, extendsi)
                       which <- seq_along(which)[!is.na(which)]
                       if (length(which)) {
                         Classi <- thisExtends[which[1L]]
                         as(.Object, Classi) <- obj
                       }
                       else stop(gettextf("cannot use object of class %s in new():  class %s does not extend that class", 
                         dQuote(Classi), dQuote(Class)), domain = NA)
                     }
                 }
             }
             if (length(elements)) {
                 snames <- names(elements)
                 if (anyDuplicated(snames)) 
                     stop(gettextf("duplicated slot names: %s", paste(sQuote(snames[duplicated(snames)]), 
                       collapse = ", ")), domain = NA)
                 which <- match(snames, names(slotDefs))
                 if (anyNA(which)) 
                     stop(sprintf(ngettext(sum(is.na(which)), "invalid name for slot of class %s: %s", 
                       "invalid names for slots of class %s: %s"), dQuote(Class), paste(snames[is.na(which)], 
                       collapse = ", ")), domain = NA)
                 firstTime <- TRUE
                 for (i in seq_along(snames)) {
                     slotName <- snames[[i]]
                     slotClass <- slotDefs[[slotName]]
                     slotClassDef <- getClassDef(slotClass, package = ClassDef@package)
                     slotVal <- elements[[i]]
                     if (!.identC(class(slotVal), slotClass) && !is.null(slotClassDef)) {
                       valClass <- class(slotVal)
                       valClassDef <- getClassDef(valClass, package = ClassDef@package)
                       if (!identical(possibleExtends(valClass, slotClass, valClassDef, 
                         slotClassDef), FALSE)) 
                         slotVal <- as(slotVal, slotClass, strict = FALSE)
                     }
                     if (firstTime) {
                       slot(.Object, slotName, check = FALSE) <- slotVal
                       firstTime <- FALSE
                     }
                     else {
                       `slot<-`(.Object, slotName, check = FALSE, slotVal)
                     }
                 }
             }
             validObject(.Object)
         }
         .Object
     }, target = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), defined = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), generic = structure("initialize", package = "methods"), class = structure("derivedDefaultMethod", package = "methods")))(.Object, 
         ...), class = structure("nonstandardGenericFunction", package = "methods")), 
         <environment>)
  15: .findInheritedMethods(classes, fdef, mtable)
  16: (function (x) 
     x$.self$finalize())(<environment>)
  
  -- 2. Error: (unknown) (@tests_map_bimap.R#31)  --------------------------------
  no function to return from, jumping to top level
  1: test_that("map shows", {
         expect_output(show(bimap("integer", "numeric")))
     }) at testthat/tests_map_bimap.R:31
  2: test_code(desc, code, env = parent.frame())
  3: 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) {
     })
  4: tryCatchList(expr, classes, parentenv, handlers)
  5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], 
         parentenv, handlers[[nh]])
  6: doTryCatch(return(expr), name, parentenv, handler)
  7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: doTryCatch(return(expr), name, parentenv, handler)
  10: 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)
  ...
  19: force(code)
  20: withVisible(code)
  21: eval_bare(get_expr(quo), get_env(quo))
  22: show(bimap("integer", "numeric"))
  23: bimap("integer", "numeric")
  24: methods::new(bimap_id)
  25: initialize(value, ...)
  26: (function (classes, fdef, mtable) 
     {
         methods <- .findInheritedMethods(classes, fdef, mtable)
         if (length(methods) == 1L) 
             return(methods[[1L]])
         else if (length(methods) == 0L) {
             cnames <- paste0("\"", vapply(classes, as.character, ""), "\"", collapse = ", ")
             stop(gettextf("unable to find an inherited method for function %s for signature %s", 
                 sQuote(fdef@generic), sQuote(cnames)), domain = NA)
         }
         else stop("Internal error in finding inherited methods; didn't return a unique method", 
             domain = NA)
     })(list(structure("Rcpp_bimap_id", package = "datastructures")), structure(function (.Object, 
         ...) 
     {
         value <- standardGeneric("initialize")
         if (!identical(class(value), class(.Object))) {
             cv <- class(value)
             co <- class(.Object)
             if (.identC(cv[[1L]], co)) {
                 if (is.na(match(cv, .BasicClasses)) && length(cv) == 1L) {
                     warning(gettextf("missing package slot (%s) in object of class %s (package info added)", 
                       packageSlot(co), dQuote(class(.Object))), domain = NA)
                     class(value) <- class(.Object)
                 }
                 else return(value)
             }
             else stop(gettextf("'initialize' method returned an object of class %s instead of the required class %s", 
                 paste(dQuote(class(value)), collapse = ", "), dQuote(class(.Object))), 
                 domain = NA)
         }
         value
     }, generic = structure("initialize", package = "methods"), package = "methods", group = list(), valueClass = character(0), signature = structure(".Object", simpleOnly = TRUE), default = structure(function (.Object, 
         ...) 
     {
         args <- list(...)
         if (length(args)) {
             Class <- class(.Object)
             if (!is.na(match(Class, .BasicClasses))) 
                 return(newBasic(Class, ...))
             ClassDef <- getClass(Class)
             snames <- allNames(args)
             which <- nzchar(snames)
             elements <- args[which]
             supers <- args[!which]
             thisExtends <- names(ClassDef@contains)
             slotDefs <- ClassDef@slots
             dataPart <- slotDefs[[".Data"]]
             if (is.null(dataPart)) 
                 dataPart <- "missing"
             if (length(supers)) {
                 for (i in rev(seq_along(supers))) {
                     obj <- supers[[i]]
                     Classi <- class(obj)
                     if (length(Classi) > 1L) 
                       Classi <- Classi[[1L]]
                     if (.identC(Classi, Class)) 
                       .Object <- obj
                     else if (extends(Classi, Class)) 
                       .Object <- as(obj, Class, strict = FALSE)
                     else if (extends(Class, Classi)) 
                       as(.Object, Classi) <- obj
                     else if (extends(Classi, dataPart)) 
                       .Object@.Data <- obj
                     else {
                       extendsi <- extends(Classi)[-1L]
                       which <- match(thisExtends, extendsi)
                       which <- seq_along(which)[!is.na(which)]
                       if (length(which)) {
                         Classi <- thisExtends[which[1L]]
                         as(.Object, Classi) <- obj
                       }
                       else stop(gettextf("cannot use object of class %s in new():  class %s does not extend that class", 
                         dQuote(Classi), dQuote(Class)), domain = NA)
                     }
                 }
             }
             if (length(elements)) {
                 snames <- names(elements)
                 if (anyDuplicated(snames)) 
                     stop(gettextf("duplicated slot names: %s", paste(sQuote(snames[duplicated(snames)]), 
                       collapse = ", ")), domain = NA)
                 which <- match(snames, names(slotDefs))
                 if (anyNA(which)) 
                     stop(sprintf(ngettext(sum(is.na(which)), "invalid name for slot of class %s: %s", 
                       "invalid names for slots of class %s: %s"), dQuote(Class), paste(snames[is.na(which)], 
                       collapse = ", ")), domain = NA)
                 firstTime <- TRUE
                 for (i in seq_along(snames)) {
                     slotName <- snames[[i]]
                     slotClass <- slotDefs[[slotName]]
                     slotClassDef <- getClassDef(slotClass, package = ClassDef@package)
                     slotVal <- elements[[i]]
                     if (!.identC(class(slotVal), slotClass) && !is.null(slotClassDef)) {
                       valClass <- class(slotVal)
                       valClassDef <- getClassDef(valClass, package = ClassDef@package)
                       if (!identical(possibleExtends(valClass, slotClass, valClassDef, 
                         slotClassDef), FALSE)) 
                         slotVal <- as(slotVal, slotClass, strict = FALSE)
                     }
                     if (firstTime) {
                       slot(.Object, slotName, check = FALSE) <- slotVal
                       firstTime <- FALSE
                     }
                     else {
                       `slot<-`(.Object, slotName, check = FALSE, slotVal)
                     }
                 }
             }
             validObject(.Object)
         }
         .Object
     }, target = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), defined = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), generic = structure("initialize", package = "methods"), class = structure("derivedDefaultMethod", package = "methods")), skeleton = (structure(function (.Object, 
         ...) 
     {
         args <- list(...)
         if (length(args)) {
             Class <- class(.Object)
             if (!is.na(match(Class, .BasicClasses))) 
                 return(newBasic(Class, ...))
             ClassDef <- getClass(Class)
             snames <- allNames(args)
             which <- nzchar(snames)
             elements <- args[which]
             supers <- args[!which]
             thisExtends <- names(ClassDef@contains)
             slotDefs <- ClassDef@slots
             dataPart <- slotDefs[[".Data"]]
             if (is.null(dataPart)) 
                 dataPart <- "missing"
             if (length(supers)) {
                 for (i in rev(seq_along(supers))) {
                     obj <- supers[[i]]
                     Classi <- class(obj)
                     if (length(Classi) > 1L) 
                       Classi <- Classi[[1L]]
                     if (.identC(Classi, Class)) 
                       .Object <- obj
                     else if (extends(Classi, Class)) 
                       .Object <- as(obj, Class, strict = FALSE)
                     else if (extends(Class, Classi)) 
                       as(.Object, Classi) <- obj
                     else if (extends(Classi, dataPart)) 
                       .Object@.Data <- obj
                     else {
                       extendsi <- extends(Classi)[-1L]
                       which <- match(thisExtends, extendsi)
                       which <- seq_along(which)[!is.na(which)]
                       if (length(which)) {
                         Classi <- thisExtends[which[1L]]
                         as(.Object, Classi) <- obj
                       }
                       else stop(gettextf("cannot use object of class %s in new():  class %s does not extend that class", 
                         dQuote(Classi), dQuote(Class)), domain = NA)
                     }
                 }
             }
             if (length(elements)) {
                 snames <- names(elements)
                 if (anyDuplicated(snames)) 
                     stop(gettextf("duplicated slot names: %s", paste(sQuote(snames[duplicated(snames)]), 
                       collapse = ", ")), domain = NA)
                 which <- match(snames, names(slotDefs))
                 if (anyNA(which)) 
                     stop(sprintf(ngettext(sum(is.na(which)), "invalid name for slot of class %s: %s", 
                       "invalid names for slots of class %s: %s"), dQuote(Class), paste(snames[is.na(which)], 
                       collapse = ", ")), domain = NA)
                 firstTime <- TRUE
                 for (i in seq_along(snames)) {
                     slotName <- snames[[i]]
                     slotClass <- slotDefs[[slotName]]
                     slotClassDef <- getClassDef(slotClass, package = ClassDef@package)
                     slotVal <- elements[[i]]
                     if (!.identC(class(slotVal), slotClass) && !is.null(slotClassDef)) {
                       valClass <- class(slotVal)
                       valClassDef <- getClassDef(valClass, package = ClassDef@package)
                       if (!identical(possibleExtends(valClass, slotClass, valClassDef, 
                         slotClassDef), FALSE)) 
                         slotVal <- as(slotVal, slotClass, strict = FALSE)
                     }
                     if (firstTime) {
                       slot(.Object, slotName, check = FALSE) <- slotVal
                       firstTime <- FALSE
                     }
                     else {
                       `slot<-`(.Object, slotName, check = FALSE, slotVal)
                     }
                 }
             }
             validObject(.Object)
         }
         .Object
     }, target = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), defined = structure("ANY", class = structure("signature", package = "methods"), .Names = ".Object", package = "methods"), generic = structure("initialize", package = "methods"), class = structure("derivedDefaultMethod", package = "methods")))(.Object, 
         ...), class = structure("nonstandardGenericFunction", package = "methods")), 
         <environment>)
  27: .findInheritedMethods(classes, fdef, mtable)
  28: (function (x) 
     x$.self$finalize())(<environment>)
  
  Error in (function (x)  : 
    no function to return from, jumping to top level
  == testthat results  ===========================================================
  OK: 113 SKIPPED: 0 FAILED: 2
  1. Error: map shows (@tests_map_bimap.R#32) 
  2. Error: (unknown) (@tests_map_bimap.R#31) 
  
  Error: testthat unit tests failed
  Execution halted