From 496b5897b467aa59efe3aa353be93076ec5789b0 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 14 May 2025 00:36:23 +0200 Subject: [PATCH] use actually invalid regex when testing for error Using a bare curly brace is not a fatal error in a regular expression. Instead, the regex is failing to be compiled because the code tests it using a string eval like `eval "m{$_}"`. Instead, use a regular expression that is fully invalid by using an unmatched square bracket. --- t/pod/pod2usage2.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/pod/pod2usage2.t b/t/pod/pod2usage2.t index 0ed928c..9876347 100644 --- a/t/pod/pod2usage2.t +++ b/t/pod/pod2usage2.t @@ -386,7 +386,7 @@ SKIP: { } # bad regexp syntax -($exit, $text) = getoutput( sub { pod2usage( -verbose => 99, -sections => 'DESCRIPTION{BLAH') } ); +($exit, $text) = getoutput( sub { pod2usage( -verbose => 99, -sections => 'DESCRIPTION[BLAH') } ); like ($text, qr/Bad regular expression/, "Output test pod2usage with bad section regexp"); } # end SKIP