From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 973FE1F4CC for ; Fri, 13 Dec 2024 18:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1734114991; bh=A01nsdUgJoQEINF1Q4sVMloa415v95CTBGdcHd2A5cM=; h=From:To:Subject:Date:From; b=Dg2YAn9OfsNoR2qYEuiywslpLrB+nCTiPzm0ZNAblnO6t0IGXxdO3EZlIqS2GghHj a4ae+uniKdiHNSAVMjWzvTA2caVP/Jn7LsJfMFDRzHdLS9ENke8Ylq1/4N0Esl7yqH am9tR/l9rbA9MT70STT+AsZrcObNAQg4lA/WVWWI= From: Eric Wong 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 Message-ID: <20241213183631.752071-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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'; } {