powered by
Require usage of expect_null(x) over expect_equal(x, NULL) and similar usages.
expect_null(x)
expect_equal(x, NULL)
expect_null_linter()
best_practices, package_development
testthat::expect_null() exists specifically for testing for NULL objects. testthat::expect_equal(), testthat::expect_identical(), and testthat::expect_true() can also be used for such tests, but it is better to use the tailored function instead.
testthat::expect_null()
NULL
testthat::expect_equal()
testthat::expect_identical()
testthat::expect_true()
linters for a complete list of linters available in lintr.