tests/testthat/test-routine_registration_linter.R

patrick::with_parameters_test_that(
  "lints correctly",
  {
    linter <- routine_registration_linter()
    expect_lint(sprintf("%s(ROUTINE, 1)", caller), NULL, linter)
    expect_lint(
      sprintf("%s('ROUTINE', PACKAGE = 'foo')", caller),
      "Register your native code routines with useDynLib",
      linter
    )
  },
  .test_name = c(".C", ".Call", ".External", ".Fortran"),
  caller = c(".C", ".Call", ".External", ".Fortran")
)

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.