Running ‘testthat.R’ [3s/3s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(exampletestr)
  > 
  > test_check("exampletestr")
  Package: tempkg
  Title: What the Package Does (one line, title case)
  Version: 0.0.0.9000
  Authors@R: person("First", "Last", email = "first.last@example.com", role = c("aut", "cre"))
  Description: What the package does (one paragraph).
  Depends: R (>= 3.4.1)
  License: What license is it under?
  Encoding: UTF-8
  LazyData: true
  Writing NAMESPACE
  Writing extract_examples.Rd
  Writing make_test_shell.Rd
  Writing make_tests_shells_file.Rd
  Package: tempkg
  Title: What the Package Does (one line, title case)
  Version: 0.0.0.9000
  Authors@R: person("First", "Last", email = "first.last@example.com", role = c("aut", "cre"))
  Description: What the package does (one paragraph).
  Depends: R (>= 3.4.1)
  License: What license is it under?
  Encoding: UTF-8
  LazyData: true
  Writing NAMESPACE
  Writing extract_examples.Rd
  Writing make_test_shell.Rd
  Writing make_tests_shells_file.Rd
  Package: tempkg
  Title: What the Package Does (one line, title case)
  Version: 0.0.0.9000
  Authors@R: person("First", "Last", email = "first.last@example.com", role = c("aut", "cre"))
  Description: What the package does (one paragraph).
  Depends: R (>= 3.4.1)
  License: What license is it under?
  Encoding: UTF-8
  LazyData: true
  Writing NAMESPACE
  Writing extract_examples.Rd
  Writing make_test_shell.Rd
  Writing make_tests_shells_file.Rd
  Writing fx.Rd
  1. Error: make_tests_shells_file works (@test_exemplar.R#162) ------------------
  all connections are in use
  1: expect_equal(make_tests_shells_pkg(overwrite = TRUE), lapply(c("exampletestr", "exemplar", 
         "non_documented_fun"), make_tests_shells_file, overwrite = TRUE)) at testthat/test_exemplar.R:162
  2: compare(object, expected, ...)
  3: make_tests_shells_pkg(overwrite = TRUE)
  4: list.files(path = "R") %>% lapply(make_tests_shells_file, overwrite = overwrite, 
         e_e = e_e) %>% invisible
  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: lapply(., make_tests_shells_file, overwrite = overwrite, e_e = e_e)
  12: FUN(X[[i]], ...)
  13: mapply(make_test_shell, SIMPLIFY = FALSE, exampless, paste(names(exampless), "works"), 
         e_e = e_e)
  14: (function (example_block, desc = "", e_e = TRUE) 
     {
         stopifnot(is.character(example_block))
         if (filesstrings::AllEqual(example_block, character(0))) 
             return(character(0))
         expressions <- extract_expressions(example_block)
         if (e_e) {
             for_checking <- expressions %>% lapply(filesstrings::RemoveQuoted) %>% lapply(stringr::str_replace_all, 
                 " ", "")
             leave_alone <- vapply(for_checking, function(x) {
                 any(stringr::str_detect(x, paste0("(?:<-|^stop\\(|^warning\\(|^#|^setwd\\(|^library\\(|", 
                     "^plot\\(|^ggplot\\(|^print\\(|^set\\.seed\\()")))
             }, logical(1))
             inside_test_that <- mapply(function(x, y) {
                 if (x) {
                     y
                 }
                 else {
                     construct_expect_equal(y)
                 }
             }, leave_alone, expressions, SIMPLIFY = FALSE) %>% unlist
         }
         else {
             inside_test_that <- unlist(expressions)
         }
         c(paste0("test_that(\"", desc, "\", {"), paste(" ", inside_test_that), "})")
     })(dots[[1L]][[3L]], dots[[2L]][[3L]], e_e = dots[[3L]][[1L]])
  15: extract_expressions(example_block)
  16: purrr::map(expr_groups, ~formatR::tidy_source(text = ., comment = !remove_comments, 
         arrow = TRUE, indent = 2, output = FALSE, width.cutoff = 50)) %>% purrr::map(getElement, 
         "text.tidy") %>% purrr::map(~readLines(textConnection(.)))
  17: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  18: eval(quote(`_fseq`(`_lhs`)), env, env)
  19: eval(quote(`_fseq`(`_lhs`)), env, env)
  20: `_fseq`(`_lhs`)
  21: freduce(value, `_function_list`)
  22: withVisible(function_list[[k]](value))
  23: function_list[[k]](value)
  24: purrr::map(., ~readLines(textConnection(.)))
  25: .f(.x[[i]], ...)
  26: readLines(textConnection(.))
  27: textConnection(.)
  
  testthat results ================================================================
  OK: 26 SKIPPED: 0 FAILED: 1
  1. Error: make_tests_shells_file works (@test_exemplar.R#162) 
  
  Error: testthat unit tests failed
  Execution halted