From efb9c1334e5e62ff5a79f7c3fec1bed8a9d1719f Mon Sep 17 00:00:00 2001 From: MEO265 <99362508+MEO265@users.noreply.github.com> Date: Wed, 10 Jan 2024 21:02:21 +0100 Subject: [PATCH] tests: Add second tests for `stopifnot` --- tests/testthat/test-handlers.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testthat/test-handlers.R b/tests/testthat/test-handlers.R index 5c2a7ad..e633768 100644 --- a/tests/testthat/test-handlers.R +++ b/tests/testthat/test-handlers.R @@ -46,6 +46,9 @@ test_that("stopifnot",{ expect_identical_error(stopifnot(f(x = FALSE)), base::stopifnot(f(x = FALSE))) g <- function () f(FALSE) expect_identical_error(stopifnot(4 == 4, g()), base::stopifnot(4==4, g())) + expect_identical_error(stopifnot(4 == 4, "Test" = g()), base::stopifnot(4==4, "Test" = g())) + expect_identical_error(stopifnot(exprs = {TRUE; FALSE}), base::stopifnot(exprs = {TRUE; FALSE})) + expect_identical_error(stopifnot(exprObject = {TRUE; FALSE}), base::stopifnot(exprObject = {TRUE; FALSE})) expect_no_error(stopifnot(TRUE, 3 == 3)) })