From f1b8cacd33a33b09ea9554c69c94eef5d510dc31 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Thu, 6 Mar 2025 15:42:30 -0800 Subject: [PATCH] move '!' outside aggregation --- R/mock2.R | 2 +- R/reporter-list.R | 2 +- vignettes/test-fixtures.Rmd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/mock2.R b/R/mock2.R index 29cfcda43..6a1c0c78d 100644 --- a/R/mock2.R +++ b/R/mock2.R @@ -144,7 +144,7 @@ local_mocked_bindings <- function(..., .package = NULL, .env = caller_env()) { local_bindings_rebind(!!!bindings, .env = test_env, .frame = .env) } - if (any(!bindings_found)) { + if (!all(bindings_found)) { missing <- names(bindings)[!bindings_found] cli::cli_abort("Can't find binding for {.arg {missing}}") } diff --git a/R/reporter-list.R b/R/reporter-list.R index 39b0c3d74..989a9ee78 100644 --- a/R/reporter-list.R +++ b/R/reporter-list.R @@ -126,7 +126,7 @@ all_passed <- function(res) { } df <- as.data.frame.testthat_results(res) - sum(df$failed) == 0 && all(!df$error) + sum(df$failed) == 0 && !any(df$error) } any_warnings <- function(res) { diff --git a/vignettes/test-fixtures.Rmd b/vignettes/test-fixtures.Rmd index 2a2bd5c19..5e9b73960 100644 --- a/vignettes/test-fixtures.Rmd +++ b/vignettes/test-fixtures.Rmd @@ -291,7 +291,7 @@ test_that("use_roxygen_md() adds DESCRIPTION fields", { use_roxygen_md() expect_true(uses_roxygen_md()) - expect_equal(desc::desc_get("Roxygen", pkg)[[1]], "list(markdown = TRUE)")) + expect_equal(desc::desc_get("Roxygen", pkg)[[1]], "list(markdown = TRUE)") expect_true(desc::desc_has_fields("RoxygenNote", pkg)) }) ```