Skip to content

Commit

Permalink
improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Jun 15, 2023
1 parent 3ff5f41 commit cd20740
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/internal_fun.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ simulate_border_config <- function(sf_object, nbc, output='vector', bootstrap_bo
if( isFALSE(bootstrap_border) ) { positions <- candidate_positions; nbc <- length(candidate_positions) }
if( isTRUE(bootstrap_border) ) { positions <- sample_positions(nbc = nbc, candidate_positions = candidate_positions) }

if (output == 'spatial') {
if (output == 'spatial') { # nocov start
# number of jobs per cell
jobs_per_cell <- 1 / nbc

Expand All @@ -155,7 +155,7 @@ simulate_border_config <- function(sf_object, nbc, output='vector', bootstrap_bo
sf_object$nbc <- nbc

return(sf_object)
}
} # nocov end

if (output == 'vector') {
# with all activities equally concentraded in 'positions'
Expand Down
2 changes: 1 addition & 1 deletion R/uci.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ uci <- function(sf_object,
distance = distance_border)
}
# parallel
else if (isTRUE(parallel)) {
if (isTRUE(parallel)) {
all_sim_venables <- furrr::future_map(
.x = all_sim,
.f = venables,
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_rafa/test_rafa.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


##### Coverage ------------------------
library(uci)
# library(uci)
library(testthat)
library(covr)
Sys.setenv(NOT_CRAN = "true")
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test_uci.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ test_that("expected behavior", {
result <- tester(parallel = TRUE)
testthat::expect_is(result, "data.frame")

result <- tester(parallel = TRUE, bootstrap_border = TRUE)
testthat::expect_is(result, "data.frame")

result <- tester(bootstrap_border = TRUE, showProgress = TRUE)
testthat::expect_is(result, "data.frame")

Expand Down

0 comments on commit cd20740

Please sign in to comment.