tests/testthat/test-sanitize.R

context("test-sanitize")

test_that("sanitize utility works", {

  # expect escape
  expect_equal(sanitize("["), "\\[")

  # expect escape
  expect_equal(sanitize("\\[|+$"), "\\\\\\[\\|\\+\\$")

})

Try the RVerbalExpressions package in your browser

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

RVerbalExpressions documentation built on Nov. 6, 2019, 5:08 p.m.