Skip to content

Commit

Permalink
Prefer compact()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jan 11, 2024
1 parent 5d492e5 commit 2fbe7ac
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/tweaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ make_tweaks <- function(envir = parent.frame()) {
}
}
ret <- .(list_call)
ret <- ret[!vapply(ret, is.null, logical(1L))]
ret <- compact(ret)
structure(ret, class = "DBItest_tweaks")
},
as.environment(list(list_call = list_call))
Expand Down
5 changes: 0 additions & 5 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ random_table_name <- function(n = 10) {
paste0("dbit", paste(sample(letters, n, replace = TRUE), collapse = ""))
}

compact <- function(x) {
x[!vapply(x, is.null, logical(1L))]
}


try_silent <- function(code) {
tryCatch(
code,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-consistency.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("no unnamed specs", {
tests <- spec_all[!vapply(spec_all, is.null, logical(1L))]
tests <- compact(spec_all)
vicinity <- NULL
if (any(names(tests) == "")) {
vicinity <- sort(unique(unlist(
Expand Down

0 comments on commit 2fbe7ac

Please sign in to comment.