paleolimbot commented on code in PR #14930:
URL: https://github.com/apache/arrow/pull/14930#discussion_r1047570654


##########
r/tests/testthat/test-filesystem.R:
##########
@@ -130,6 +129,21 @@ test_that("LocalFileSystem + Selector", {
   expect_equal(sum(types == FileType$Directory), 1L)
 })
 
+test_that("clean_path_abs() marks its output as utf-8", {
+  f <- tempfile(fileext = "Público")
+  on.exit(unlink(f))
+
+  file.create(f)
+  f_utf8 <- enc2utf8(normalizePath(f, winslash = "/"))
+  f_latin1 <- iconv(f_utf8, "utf-8", "latin1")
+
+  expect_identical(clean_path_abs(f_utf8), f_utf8)

Review Comment:
   `expect_identical(clean_path_abs(f_utf8), f_utf8)` and 
`expect_identical(clean_path_abs(f_latin1), f_latin1)` will both pass because 
`identical()` knows about character encodings; 
`expect_identical(Encoding(clean_path_abs(f_utf8)), Encoding(f_utf8))` and 
`expect_identical(Encoding(clean_path_abs(f_latin1)), Encoding(f_utf8))` both 
fail for me on current master (could be just MacOS).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to