tests/testthat/test-rfind.R

test_that("strs_rfind works", {
  expect_equal(strs_rfind("words", "r"), 3)
  expect_equal(strs_rfind(c("words", "groovy"), "r"), c(3, 2))
  expect_equal(strs_rfind(c("words", "groovy", "z"), "r"), c(3, 2, NA_integer_))
  expect_equal(strs_rfind("wordswords", "r"), 8)
})

Try the strs package in your browser

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

strs documentation built on Sept. 11, 2024, 6:44 p.m.