tests/testthat/test-make_linter_from_regex.R

test_that("test make_linter_from_regex works", {
  linter <- lintr:::make_linter_from_regex("-", "style", "Silly lint.")()
  expect_lint("a <- 2L", "Silly lint.", linter)
  expect_lint("a = '2-3'", NULL, linter)
})

Try the lintr package in your browser

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

lintr documentation built on Nov. 7, 2023, 5:07 p.m.