tests/testthat/test-str_rtl.R

test_that("str_rtl() adds RTL-embeeding Unicode character", {
  expect_equal(
    str_rtl("א.", "ב."),
    stringr::str_c("\u202B", stringr::str_c("א.", "ב.", sep = "\u202B"))
  )
  expect_equal(
    str_rtl("א.", "ב.", multiline = TRUE),
    stringr::str_c("\u202B", stringr::str_c("א.", "ב.", sep = "\n\u202B", collapse = "\n\u202B"))
  )
})

Try the rtlr package in your browser

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

rtlr documentation built on April 4, 2023, 5:15 p.m.