Skip to content

Commit 129b930

Browse files
committed
fixed Non ASCII characters
1 parent f38db32 commit 129b930

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

r-package/R/build_custom_network.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ build_custom_network <- function(data_path,
8888

8989
# manipulate data_path directory
9090
data_pbf_files <- list.files(data_path, pattern = "\\.pbf$", full.names = TRUE)
91-
if (length(data_pbf_files) != 1) {
92-
stop(sprintf("data_path must contain exactly one .pbf file, found: %d", length(data_pbf_files)))
91+
if (length(data_pbf_files) > 1) {
92+
cli::cli_abort(
93+
"`.path {output_path}` must contain at most one {.file .pbf} file; found {length(data_pbf_files)} file{?s}."
94+
)
9395
}
96+
97+
9498
pbf_path <- data_pbf_files[[1]]
9599
checkmate::assert_file_exists(pbf_path, access = "r", extension = "pbf")
96100

@@ -105,7 +109,7 @@ build_custom_network <- function(data_path,
105109
# message copied files
106110
formatted_files <- paste0("{.file ", basename(files_to_copy), "}", collapse = ", ")
107111
cli::cli_inform(c(
108-
i = "Copying {length(files_to_copy)} file{?s}: {formatted_files} {.path {output_path}}"
112+
i = "Copying {length(files_to_copy)} file{?s}: {formatted_files} to {.path {output_path}}"
109113
))
110114

111115
# manipulate output_path directory

r-package/tests/testthat/test-build_custom_network.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ test_that("errors due to incorrect input types", {
130130

131131
test_that("overwrite existing network in outputdir", {
132132

133-
new_r5r_network <- tester()
134-
new_r5r_network <- tester()
133+
testthat::expect_message(new_r5r_network <- tester())
135134
expect_true(is(new_r5r_network, "r5r_network"))
136135

137136
})

0 commit comments

Comments
 (0)