develooper Front page | perl.perl5.porters | Postings from December 2018

[perl #133713] [PATCH] Fix B extension skip in ext/B/t/strict.t

Thread Previous
From:
Petr Pisar
Date:
December 7, 2018 11:30
Subject:
[perl #133713] [PATCH] Fix B extension skip in ext/B/t/strict.t
Message ID:
rt-4.0.24-18885-1544182245-29.133713-75-0@perl.org
# New Ticket Created by  Petr Pisar 
# Please include the string:  [perl #133713]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133713 >


If perl is built in an environment with a locale where
"B" > "attribute" (e.g. "C" locale), ext/B/t/strict.t test will be skipped
in contrast to other B tests:

../ext/B/t/showlex.t .............. ok
../ext/B/t/strict.t ............... skipped: Perl was not compiled with B

The tests match $Config{'extensions'} for "B" and skip the tests if not
found. However, ext/B/t/strict.t uses a distinct regular expression
that fails if $Config{'extensions'} starts with "B ".

This patch makes the ext/B/t/strict.t test alike to other ones.

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 ext/B/t/strict.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/B/t/strict.t b/ext/B/t/strict.t
index 4d1b84aa20..9f5eacd7da 100644
--- a/ext/B/t/strict.t
+++ b/ext/B/t/strict.t
@@ -7,7 +7,7 @@ use Config;
 use Test::More;
 
 BEGIN {
-    if ( ( $Config{'extensions'} !~ /\sB\s/ ) ) {
+    if ( ( $Config{'extensions'} !~ /\bB\b/ ) ) {
         plan skip_all => "Perl was not compiled with B";
         exit 0;
     }
-- 
2.17.2


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About