tests/testthat/test-str_locate_first.R

x <- str_locate_first("12345$9.50 for Math and $11.90 for both subjects", pattern = '\\$')

test_that("str_locate_first() returns integer vector", {
  expect_equal(class(x), "integer")
})

test_that("str_locate_first() returns correct values", {
  expect_equal(x, c(6, 25))
})
Kidapt/keda documentation built on Nov. 23, 2019, 3:35 a.m.