Skip to content

Commit

Permalink
Remove superfluous methods and increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Jan 7, 2025
1 parent 7dfe8fd commit 345ebfb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ S3method(target_debug,default)
S3method(target_debug,tar_builder)
S3method(target_ensure_buds,tar_branch)
S3method(target_ensure_buds,tar_stem)
S3method(target_get_children,default)
S3method(target_get_children,tar_pattern)
S3method(target_get_children,tar_stem)
S3method(target_get_packages,default)
Expand Down
13 changes: 0 additions & 13 deletions R/class_pipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,6 @@ pipeline_exists_target <- function(pipeline, name) {
!is.null(.subset2(envir, name))
}

pipeline_exists_import <- function(pipeline, name) {
envir <- .subset2(pipeline, "imports")
if (is.null(envir)) {
return(FALSE)
}
!is.null(.subset2(envir, name))
}

pipeline_exists_object <- function(pipeline, name) {
pipeline_exists_target(pipeline, name) ||
pipeline_exists_import(pipeline, name)
}

pipeline_targets_only_edges <- function(edges) {
edges[edges$from %in% edges$to,, drop = FALSE] # nolint
}
Expand Down
5 changes: 0 additions & 5 deletions R/class_target.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ target_get_children <- function(target) {
UseMethod("target_get_children")
}

#' @export
target_get_children.default <- function(target) {
character(0)
}

target_get_type <- function(target) {
UseMethod("target_get_type")
}
Expand Down
11 changes: 0 additions & 11 deletions R/utils_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,6 @@ file_info_0 <- data.frame(
stringsAsFactors = FALSE
)

file_info_runtime_file <- function(path, file_info) {
out <- file_info[[path]]
if (is.null(out)) {
out <- as.list(file_info(path))
out$hit <- FALSE
} else {
out$hit <- TRUE
}
out
}

file_move <- function(from, to) {
dir_create(dirname(to))
if (!suppressWarnings(file.rename(from = from, to = to))) {
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-class_database.R
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ tar_test("database$deduplicate_storage()", {
expect_equal(out, c("name|col", "x|2", "y|1", "name|z"))
})

tar_test("database$deduplicate_storage() on non-existent file", {
db <- database_init(path = tempfile(), header = c("name", "col"))
expect_silent(db$deduplicate_storage())
})

tar_test("database$validate()", {
out <- database_init(header = "name")
expect_silent(out$validate())
Expand Down

0 comments on commit 345ebfb

Please sign in to comment.