Skip to content

Commit

Permalink
debug Win GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
xec-cm committed Dec 21, 2023
1 parent 5195158 commit e23a720
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ Suggests:
testthat (>= 3.0.0)
Depends: R (>= 4.4.0)
Config/testthat/edition: 3
Config/testthat/parallel: true
Config/testthat/parallel: false
VignetteBuilder: knitr
2 changes: 1 addition & 1 deletion R/longtests_rcolet.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ roclet_process.roclet_longtests <- function(x, blocks, env, base_path) {
#' @examples
#' # Set up a temporary directory
#' base_path <- tempdir()
#' longtests_path <- file.path(base_path, "longtests")
#' longtests_path <- file.path(base_path, "longtests", "testthat")
#' unlink(longtests_path, recursive = TRUE, force = TRUE)
#' dir.create(longtests_path, recursive = TRUE, showWarnings = FALSE)
#'
Expand Down
3 changes: 1 addition & 2 deletions R/utils_longtests_rcolet.R
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ internal_longtests_roclet_output <- function(results,

content <- results[[i]]

# useBytes = TRUE not working on Windows
writeLines(text = enc2utf8(content), con = path, useBytes = FALSE)
writeLines(text = enc2utf8(content), con = path, useBytes = TRUE)
}

paths
Expand Down
2 changes: 1 addition & 1 deletion man/roclet_output.roclet_longtests.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions tests/testthat/test-roclet_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("roclet_output.roclet_longtests returns correct paths", {
# Setup:
base_path <- tempdir()
longtests_path <- file.path(base_path, "longtests", "testthat")
unlink(longtests_path, recursive = TRUE, force = TRUE)
unlink(file.path(base_path, "longtests"), recursive = TRUE, force = TRUE)
results <- roxygen2::roc_proc_text(longtests_roclet(), "
#' Summing two numbers
#'
Expand All @@ -17,6 +17,7 @@ test_that("roclet_output.roclet_longtests returns correct paths", {
x + y
}")

names(results$longtests) <- "test.R"
# Check error when longtests directory does not exist
expect_error(roclet_output.roclet_longtests(NULL, results, base_path))

Expand All @@ -25,5 +26,5 @@ test_that("roclet_output.roclet_longtests returns correct paths", {

# Check that the function returns the correct paths
roclet_output.roclet_longtests(NULL, results, base_path) |>
expect_equal("<text>")
expect_equal("test.R")
})

0 comments on commit e23a720

Please sign in to comment.