From ebea1fad37029704bc58e04af2eb9caead7b9224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C5=8Dan?= Date: Thu, 12 Mar 2026 22:32:50 -0600 Subject: [PATCH] test: fix _check_for_croak() to validate error messages with like() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The helper used ok($@, "/$expected/") which only checked that $@ was truthy — the second argument was just the test description, not a regex match. Replace with like($@, qr/$expected/) to actually validate that croak produces the expected error message. Co-Authored-By: Claude Opus 4.6 --- t/rsa.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/rsa.t b/t/rsa.t index 94a0d87..c13030b 100644 --- a/t/rsa.t +++ b/t/rsa.t @@ -54,7 +54,7 @@ sub _Test_Sign_And_Verify { sub _check_for_croak { my ( $code, $expected ) = @_; eval { &$code() }; - ok( $@, "/$expected/" ); + like( $@, qr/$expected/, "croak matches: $expected" ); } # On platforms without a /dev/random, we need to manually seed. In