Running ‘testthat.R’ [51s/76s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(admiral)
  > 
  > test_check("admiral")
  [ FAIL 5 | WARN 5 | SKIP 0 | PASS 314 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-call_derivation.R:6:3): call_derivation works ───────────────────
  Error in `eval(code, test_env)`: object 'vs' not found
  ── Error (test-call_derivation.R:61:3): call_derivation works ──────────────────
  Error in `dplyr::left_join(x, y, by = by, copy = copy, suffix = suffix, 
      ...)`: object 'ae' not found
  Backtrace:
      ▆
   1. ├─ae[sample(seq_len(nrow(ae)), 1000), ] %>% ... at test-call_derivation.R:61:2
   2. └─admiral:::left_join(., adsl, by = "USUBJID")
   3.   ├─admiral::suppress_warning(...)
   4.   │ └─base::withCallingHandlers(...)
   5.   └─dplyr::left_join(...)
  ── Error (test-warnings.R:6:3): a warning is issued when a variable to be derived already exists in the input dataset ──
  Error in `is.data.frame(x)`: object 'dm' not found
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(warn_if_vars_exist(dm, "AGE"), "Variable `AGE` already exists in the dataset") at test-warnings.R:6:2
   2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─admiral::warn_if_vars_exist(dm, "AGE")
   7.   ├─vars %in% colnames(dataset)
   8.   └─base::colnames(dataset)
   9.     └─base::is.data.frame(x)
  ── Failure (test_assertions.R:6:3): an error is thrown if a required variable is missing ──
  `assert_has_variables(dm, "TRT01P")` threw an error with unexpected message.
  Expected match: "Required variable `TRT01P` is missing."
  Actual message: "object 'dm' not found"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(assert_has_variables(dm, "TRT01P"), "Required variable `TRT01P` is missing.") at test_assertions.R:6:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─admiral::assert_has_variables(dm, "TRT01P")
   7.   ├─required_vars %in% colnames(dataset)
   8.   └─base::colnames(dataset)
   9.     └─base::is.data.frame(x)
  ── Failure (test_assertions.R:15:3): no error is thrown if a required variable exists ──
  `assert_has_variables(dm, "USUBJID")` threw an error.
  Message: object 'dm' not found
  Class:   simpleError/error/condition
  Backtrace:
      ▆
   1. ├─testthat::expect_error(assert_has_variables(dm, "USUBJID"), NA) at test_assertions.R:15:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─admiral::assert_has_variables(dm, "USUBJID")
   7.   ├─required_vars %in% colnames(dataset)
   8.   └─base::colnames(dataset)
   9.     └─base::is.data.frame(x)
  
  [ FAIL 5 | WARN 5 | SKIP 0 | PASS 314 ]
  Error: Test failures
  Execution halted