diff --git a/R/utils.R b/R/utils.R index 3df1308de..476f04729 100644 --- a/R/utils.R +++ b/R/utils.R @@ -2,8 +2,6 @@ #' @export magrittr::`%>%` -null <- function(...) invisible() - escape_regex <- function(x) { chars <- c( "*", diff --git a/tests/testthat/_snaps/expect-condition.md b/tests/testthat/_snaps/expect-condition.md index 915b6cc98..f5c2cb04b 100644 --- a/tests/testthat/_snaps/expect-condition.md +++ b/tests/testthat/_snaps/expect-condition.md @@ -1,6 +1,6 @@ # regexp = NULL checks for presence of error - `null()` did not throw the expected error. + `{ ... }` did not throw the expected error. # regexp = string matches for error message diff --git a/tests/testthat/test-expect-condition.R b/tests/testthat/test-expect-condition.R index 636e3cc55..5ae9ba3ef 100644 --- a/tests/testthat/test-expect-condition.R +++ b/tests/testthat/test-expect-condition.R @@ -5,11 +5,11 @@ test_that("returns condition or value", { test_that("regexp = NULL checks for presence of error", { expect_success(expect_error(stop())) - expect_snapshot_failure(expect_error(null())) + expect_snapshot_failure(expect_error({})) }) test_that("regexp = NA checks for absence of error", { - expect_success(expect_error(null(), NA)) + expect_success(expect_error({}, NA)) expect_failure(expect_error(stop("Yes"), NA)) }) @@ -136,7 +136,7 @@ test_that("when checking for no warnings, exclude deprecation warnings (2e)", { # expect_message ---------------------------------------------------------- test_that("regexp = NA checks for absence of message", { - expect_success(expect_message(null(), NA)) + expect_success(expect_message({}, NA)) expect_failure(expect_message(message("!"), NA)) })