tests/testthat/test-utils.R

test_that("has_quotes", {
  expect_false(has_quotes('asd'))
  expect_false(has_quotes('"asd'))
  expect_false(has_quotes('asd"'))
  expect_false(has_quotes('as"d'))
  expect_false(has_quotes('a"s"d'))
  expect_false(has_quotes("'asd"))
  expect_false(has_quotes("asd'"))
  expect_false(has_quotes("as'd'"))
  expect_true(all(!has_quotes(c('asd', "asd"))))
  
  expect_true(has_quotes('"asd"'))
  expect_true(has_quotes("'asd'"))
  expect_true(all(has_quotes(c('"asd"', "'asd'"))))
})

Try the roxytest package in your browser

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

roxytest documentation built on Jan. 11, 2023, 5:14 p.m.