Skip to content

Commit

Permalink
fixes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
dblodgett-usgs committed Jun 28, 2024
1 parent 146f62d commit f7d5aea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/add_streamorder-level.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ add_streamorder.hy <- function(x, status = TRUE) {
error_context <- "add_streamorder"
}

if(!exists("net")) {
if(!exists("net", inherits = FALSE)) {

check_names(x, required_atts, error_context)

Expand Down
12 changes: 12 additions & 0 deletions tests/testthat/test_streamorder-level.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@ test_that("get_streamlevel", {
expect_equal(x$orig_streamlevel, add_streamlevel(x, coastal = "coastal")$stream_level)

})

test_that("exists bug #35", {

x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom")) |>
hydroloom::add_toids() |>
dplyr::select(-StreamOrde)

net = data.frame()

expect_true(is.data.frame(hydroloom::add_streamorder(x)))

})

0 comments on commit f7d5aea

Please sign in to comment.