Skip to content

Commit

Permalink
check eats LOCALE
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Dec 18, 2023
1 parent 331f31a commit 2f3150f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .dev/roxygen_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ normalize_rd <- function(rd_file) as.character(parse_Rd(rd_file))

rd_equal <- function(f1, f2) isTRUE(all.equal(normalize_rd(f1), normalize_rd(f2)))

check_roxygenize_idempotent <- function() {
check_roxygenize_idempotent <- function(LOCALE) {
Sys.setlocale("LC_COLLATE", LOCALE)
roxygenize()

new_files <- list.files(new_dir, pattern = "\\.Rd$")
Expand All @@ -41,14 +42,13 @@ check_roxygenize_idempotent <- function() {
Rd2txt(old_file)
cat("Here's the Rd2txt() output for roxygenize():\n")
Rd2txt(new_file)
stop(call. = FALSE)
stop("Failed in LOCALE=", LOCALE, ".", call. = FALSE)
}
}

# Run the check in a few locales to ensure there's no idempotency issues w.r.t. sorting, too
for (LOCALE in c("C", "en_US", "hu_HU", "ja_JP")) {
Sys.setlocale("LC_COLLATE", LOCALE)
check_roxygenize_idempotent()
check_roxygenize_idempotent(LOCALE)
}

unlink(old_dir, recursive = TRUE)

0 comments on commit 2f3150f

Please sign in to comment.