diff --git a/R/source.R b/R/source.R index 13c2f929..350fb8f9 100644 --- a/R/source.R +++ b/R/source.R @@ -441,22 +441,22 @@ check_cargo_output <- function(compilation_result, message_buffer, tty_has_color "error", tty_has_colors ) %>% - purrr::map_chr( - cli::format_inline, - keep_whitespace = TRUE - ) %>% - # removing double new lines with single new line - stringi::stri_replace_all_fixed("\n\n", "\n") %>% - # ensures that the leading cli style `x` is there - rlang::set_names("x") - - rlang::abort( - c( - "Rust code could not be compiled successfully. Aborting.", - error_messages - ), - call = call, - class = "rextendr_error" + purrr::map_chr( + cli::format_inline, + keep_whitespace = TRUE + ) %>% + # removing double new lines with single new line + stringi::stri_replace_all_fixed("\n\n", "\n") %>% + # ensures that the leading cli style `x` is there + rlang::set_names("x") + + rlang::abort( + c( + "Rust code could not be compiled successfully. Aborting.", + error_messages + ), + call = call, + class = "rextendr_error" ) } } diff --git a/tests/testthat/test-pretty_rel_path.R b/tests/testthat/test-pretty_rel_path.R index 76cfad9d..4c0c8e55 100644 --- a/tests/testthat/test-pretty_rel_path.R +++ b/tests/testthat/test-pretty_rel_path.R @@ -89,24 +89,26 @@ test_that("Find relative path providing NA as input for the package directory, r ) }) -test_that("Find relative path providing empty character vector as - input for the package directory, return absolute path", { - skip_if_not_installed("usethis") - - pkg_root <- local_package("testpkg") - use_extendr() - - expect_equal( - pretty_rel_path( - file.path(pkg_root, "R", "extendr-wrappers.R"), - character(0) - ), - normalizePath( - file.path(pkg_root, "R", "extendr-wrappers.R"), - winslash = "/" +test_that( + "Find relative path providing empty character vector as input for the package directory, return absolute path", + { + skip_if_not_installed("usethis") + + pkg_root <- local_package("testpkg") + use_extendr() + + expect_equal( + pretty_rel_path( + file.path(pkg_root, "R", "extendr-wrappers.R"), + character(0) + ), + normalizePath( + file.path(pkg_root, "R", "extendr-wrappers.R"), + winslash = "/" + ) ) - ) -}) + } +) test_that("Test path to non-existent file", { skip_if_not_installed("usethis")