tests/testthat/test-slice.R

test_that("strs_slice works", {
  expect_equal(strs_slice("hello", start = -1L), "o")
  expect_equal(strs_slice("hello", start = -1L, stop = 1L), "")
  expect_equal(strs_slice("hello", start = -2L), "lo")
})

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.