| expect_not_linter | R Documentation |
expect_false(x) over expect_true(!x)testthat::expect_false() exists specifically for testing that an output is
FALSE. testthat::expect_true() can also be used for such tests by
negating the output, but it is better to use the tailored function instead.
The reverse is also true – use expect_false(A) instead of
expect_true(!A).
expect_not_linter()
best_practices, package_development, pkg_testthat, readability
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "expect_true(!x)",
linters = expect_not_linter()
)
# okay
lint(
text = "expect_false(x)",
linters = expect_not_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.