tests/testthat/test-find_closing.R

test_that("one parathensis", {
  expect_equal(find_closing("(xxx)"), 5)
})

test_that("multiple parathenses", {
  expect_equal(find_closing("(((xxx)))"), 9)
})

test_that("no match", {
  expect_identical(find_closing("((xxxx)"), NA_integer_)
})

test_that("match on arbitrary characters", {
  expect_equal(find_closing("[xxxx X", "\\[", "X"), 7)
})

Try the r6methods package in your browser

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

r6methods documentation built on March 16, 2021, 9:06 a.m.