From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] t/filter_base: relax Regexp class match with ->isa
Date: Fri, 13 Dec 2024 18:36:31 +0000 [thread overview]
Message-ID: <20241213183631.752071-1-e@80x24.org> (raw)
It would be nice to support alternative Regexp engines such
as re::engine::PCRE2 in the future. The exact ref() name
can't match, however ->isa() works with re::engine::PCRE2.
So future-proof our code for potential changes in case PCRE2
becomes usable.
---
Unfortunately, attempting to use re::engine::PCRE2 with
PublicInbox::Eml shows t/eml.t failures from regexps made
by re_memo as well as the MIME boundary splitting with
Perl 5.32, and probably other things...
t/filter_base.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/filter_base.t b/t/filter_base.t
index 2646321a..3a0dbf8b 100644
--- a/t/filter_base.t
+++ b/t/filter_base.t
@@ -10,7 +10,7 @@ use_ok 'PublicInbox::Filter::Base';
my $f = PublicInbox::Filter::Base->new;
ok($f, 'created stock object');
ok(defined $f->{reject_suffix}, 'rejected suffix redefined');
- is(ref($f->{reject_suffix}), 'Regexp', 'reject_suffix should be a RE');
+ ok $f->{reject_suffix}->isa('Regexp'), 'reject_suffix should be a RE';
}
{
reply other threads:[~2024-12-13 18:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241213183631.752071-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).