From: Eric Wong Date: Sat, 15 Feb 2025 11:10:07 +0000 (+0000) Subject: test_common: key2sub: detect syntax errors early X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7501517ede312ef5f5589f4fc0078328185eb44;p=thirdparty%2Fpublic-inbox.git test_common: key2sub: detect syntax errors early Instead of attempting to use an `undef' $sub as a coderef; detect compile errors early and die immediately if `eval' raises an exception. --- diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index cbcfc008c..e11781491 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -371,6 +371,7 @@ sub main { } 1; EOF + die "E: $f failed: $@" if $@; $pkg->can('main'); } }