diff --git a/tests/testthat/_snaps/utf8.md b/tests/testthat/_snaps/utf8.md deleted file mode 100644 index eb2db9f6..00000000 --- a/tests/testthat/_snaps/utf8.md +++ /dev/null @@ -1,14 +0,0 @@ -# UTF-8 encoding, string input - - Code - print(out_utf8[i_out]) - Output - [1] "#> [1] \"À\" \"Ë\" \"Ð\"" - ---- - - Code - print(charToRaw(out_utf8[i_out])) - Output - [1] 23 3e 20 5b 31 5d 20 22 c3 80 22 20 22 c3 8b 22 20 22 c3 90 22 - diff --git a/tests/testthat/test-utf8.R b/tests/testthat/test-utf8.R index 605e4f05..3f99f01b 100644 --- a/tests/testthat/test-utf8.R +++ b/tests/testthat/test-utf8.R @@ -8,20 +8,17 @@ test_that("UTF-8 encoding, string input", { ) out_utf8 <- reprex(input = in_utf8) + expect_true(all(Encoding(out_utf8) %in% c("unknown", "UTF-8"))) + i_in <- grep("^x <-", in_utf8) i_out <- grep("^x <-", out_utf8) expect_identical(charToRaw(in_utf8[i_in]), charToRaw(out_utf8[i_out])) i_out <- grep("^#> \\[1\\]", out_utf8) - expect_equal(Encoding(out_utf8)[i_out], "UTF-8") expect_match(out_utf8[i_out], "[\u00C0]") expect_match(out_utf8[i_out], "[\u00CB]") expect_match(out_utf8[i_out], "[\u00D0]") - expect_snapshot(print(out_utf8[i_out])) - expect_snapshot(print(charToRaw(out_utf8[i_out]))) - #expect_snapshot(print(Sys.getlocale())) - in_latin1 <- iconv(in_utf8, from = "UTF-8", to = "latin1") out_latin1 <- reprex(input = in_latin1)