tests/testthat/test-find.R

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

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.