Skip to content

Commit 5b95679

Browse files
committed
Format tests/
1 parent 91a625b commit 5b95679

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2109
-1105
lines changed

tests/testthat/helper-encoding.R

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ get_lang_strings <- function() {
1818

1919
get_native_lang_string <- function() {
2020
lang_strings <- get_lang_strings()
21-
if (length(lang_strings$same) == 0) testthat::skip("No native language string available")
21+
if (length(lang_strings$same) == 0) {
22+
testthat::skip("No native language string available")
23+
}
2224
lang_strings$same[[1L]]
2325
}
2426

2527
get_alien_lang_string <- function() {
2628
lang_strings <- get_lang_strings()
27-
if (length(lang_strings$different) == 0) testthat::skip("No alien language string available")
29+
if (length(lang_strings$different) == 0) {
30+
testthat::skip("No alien language string available")
31+
}
2832
lang_strings$different[[1L]]
2933
}
3034

@@ -52,12 +56,13 @@ non_utf8_encoding <- function(enc = NULL) {
5256
if (!l10n_info()$`UTF-8`) {
5357
return(Sys.getlocale("LC_CTYPE"))
5458
}
55-
enc <- enc %||% c(
56-
"en_US.ISO8859-1",
57-
"en_US.ISO8859-15",
58-
"fr_CH.ISO8859-1",
59-
"fr_CH.ISO8859-15"
60-
)
59+
enc <- enc %||%
60+
c(
61+
"en_US.ISO8859-1",
62+
"en_US.ISO8859-15",
63+
"fr_CH.ISO8859-1",
64+
"fr_CH.ISO8859-15"
65+
)
6166
available <- vapply(enc, has_ctype_locale, logical(1))
6267
if (any(available)) {
6368
enc[available][1]

tests/testthat/helper-lazy.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
skip_if_no_lazy_character <- function() {
22
new_lazy_character <- import_vctrs("new_lazy_character", optional = TRUE)
3-
lazy_character_is_materialized <- import_vctrs("lazy_character_is_materialized", optional = TRUE)
3+
lazy_character_is_materialized <- import_vctrs(
4+
"lazy_character_is_materialized",
5+
optional = TRUE
6+
)
47

58
if (is.null(new_lazy_character) || is.null(lazy_character_is_materialized)) {
69
skip("Lazy character helpers from vctrs are not available.")

tests/testthat/helper-s3.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ local_methods <- function(..., .frame = caller_env()) {
33
}
44

55
local_foo_df <- function(frame = caller_env()) {
6-
local_methods(.frame = frame,
6+
local_methods(
7+
.frame = frame,
78
group_by.foo_df = function(.data, ...) {
89
out <- NextMethod()
910
if (missing(...)) {

0 commit comments

Comments
 (0)