From 7ec4ddb3b8893780a323a876a4196004a3f4c366 Mon Sep 17 00:00:00 2001 From: Maximilian Muecke Date: Fri, 7 Jun 2024 13:40:14 +0200 Subject: [PATCH] tests: use expect_match --- tests/testthat/test_encapsulate.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test_encapsulate.R b/tests/testthat/test_encapsulate.R index 8fe96600..a8a8ce75 100644 --- a/tests/testthat/test_encapsulate.R +++ b/tests/testthat/test_encapsulate.R @@ -47,12 +47,12 @@ test_that("timeout", { res = encapsulate("evaluate", .f = f, .args = list(x = 1), .timeout = 1) expect_null(res$result) expect_true("error" %in% res$log$class) - expect_true(any(grepl("time limit", res$log$msg, fixed = TRUE))) + expect_match(res$log$msg, "time limit", fixed = TRUE) res = encapsulate("callr", .f = f, .args = list(x = 1), .timeout = 1) expect_null(res$result) expect_true("error" %in% res$log$class) - expect_true(any(grepl("time limit", res$log$msg, fixed = TRUE))) + expect_match(res$log$msg, "time limit", fixed = TRUE) })