Skip to content

Commit daf6ca6

Browse files
break the unicode test into two
1 parent c68e13b commit daf6ca6

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/testthat/test-parsing.R

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ test_that("mixed CRLF / LF EOLs fail", {
3636
)
3737
})
3838

39-
test_that("unicode can't be propprely handled on Windows for R < 4.2", {
40-
msg <- ifelse(getRversion() < "4.2" && is_windows(),
41-
"Can't parse input due to unicode restriction in base R\\.",
42-
NA
39+
test_that("unicode can't be properly handled on Windows for R < 4.2", {
40+
skip_if_not(getRversion() < "4.2" && is_windows())
41+
42+
expect_error(
43+
style_text('suit <- "♠"'),
44+
"Can't parse input due to unicode restriction in base R\\."
4345
)
44-
expect_error(style_text('suit <- "♠"'), msg)
46+
})
47+
48+
test_that("unicode is properly handled in all settings other than on Windows for R < 4.2", {
49+
skip_if(getRversion() < "4.2" && is_windows())
50+
51+
expect_error(style_text('suit <- "♠"'), NA)
4552
})

0 commit comments

Comments
 (0)