tests/testthat/test-utf8-read.R

test_that("utf8 read not super broken", {
  
  filename <- tempfile()
  txt_init <- "привет"
  writeLines(txt_init, filename, sep = "")
  
  con <- file(filename, "rb")
  txt_read <- read_utf8_raw(con, file.size(filename))
  close(con)
  
  expect_identical(txt_read, txt_init)
  
})

Try the ctypesio package in your browser

Any scripts or data that you put into this service are public.

ctypesio documentation built on April 3, 2025, 7:28 p.m.