Skip to content

Commit

Permalink
fixed dominator_tree tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Feb 13, 2025
1 parent ce6cb74 commit 3dedcab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions R/flow.R
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,12 @@ st_min_cuts <- all_st_mincuts_impl
dominator_tree <- function(graph, root, mode = c("out", "in", "all", "total")) {
# Argument checks
ensure_igraph(graph)
root <- as_igraph_vs(graph, root)
if (length(root) == 0) {

if (missing(root) || is.null(root)) {
cli::cli_abort("{.arg root} must be specified.")
}
root <- as_igraph_vs(graph, root)

mode <- switch(igraph.match.arg(mode),
"out" = 1,
"in" = 2,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
dominator_tree(g_tree)
Condition
Error in `dominator_tree()`:
! argument "root" is missing, with no default
! `root` must be specified.

---

Expand Down

0 comments on commit 3dedcab

Please sign in to comment.