unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] t/filter_base: relax Regexp class match with ->isa
@ 2024-12-13 18:36 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-12-13 18:36 UTC (permalink / raw)
  To: meta

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';
 }
 
 {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-13 18:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13 18:36 [PATCH] t/filter_base: relax Regexp class match with ->isa Eric Wong

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).