Skip to contents

For readability of test outputs, testing only one thing per call to testthat::expect_true() is preferable, i.e., expect_true(A); expect_true(B) is better than expect_true(A && B), and expect_false(A); expect_false(B) is better than expect_false(A || B).

Usage

conjunct_test_linter(allow_named_stopifnot = TRUE)

Arguments

allow_named_stopifnot

Logical, TRUE by default. If FALSE, "named" calls to stopifnot(), available since R 4.0.0 to provide helpful messages for test failures, are also linted.

Details

Similar reasoning applies to && usage inside stopifnot() and assertthat::assert_that() calls.

See also

linters for a complete list of linters available in lintr.