tests/testthat/test-str_left.R

test_that("str_left() returns the left side of a string", {
  expect_equal(str_left("COVID-19", n = 5), "COVID")
  expect_equal(str_left("a,b,c"), "a")
})

Try the forstringr package in your browser

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

forstringr documentation built on Aug. 7, 2023, 5:08 p.m.