| 1 |
|
| 2 |
test_that("code containing multibyte characters can be parsed", { |
| 3 |
|
| 4 |
skip_if(renv_platform_unix() && !renv_l10n_utf8()) |
| 5 |
|
| 6 |
code <- intToUtf8(258L) # "Ă" |
| 7 |
parsed <- renv_parse_text(code) |
| 8 |
expect_true(inherits(parsed, "expression")) |
| 9 |
|
| 10 |
code <- intToUtf8(193L) # "Á" |
| 11 |
parsed <- renv_parse_text(code) |
| 12 |
expect_true(inherits(parsed, "expression")) |
| 13 |
|
| 14 |
code <- enc2utf8("Á # 鬼") |
| 15 |
parsed <- renv_parse_text(code) |
| 16 |
expect_true(inherits(parsed, "expression")) |
| 17 |
|
| 18 |
code <- enc2utf8("paste(Á, '鬼')") |
| 19 |
parsed <- renv_parse_text(code) |
| 20 |
expect_true(inherits(parsed, "expression")) |
| 21 |
|
| 22 |
code <- enc2utf8("paste(`Á`, `鬼`)") |
| 23 |
parsed <- renv_parse_text(code) |
| 24 |
expect_true(inherits(parsed, "expression")) |
| 25 |
|
| 26 |
}) |