From 7465bc322e5c5dcbd256bb5fbdd3135163fb3dc1 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 6 Mar 2011 21:58:19 +0000 Subject: Add skip_all_without_extension() to test.pl, for the common skip idiom. Use it in t/io/layers.t to skip if Encode is not built. --- t/io/layers.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 't/io/layers.t') diff --git a/t/io/layers.t b/t/io/layers.t index 01e1864135..cb7cbefea8 100644 --- a/t/io/layers.t +++ b/t/io/layers.t @@ -9,9 +9,7 @@ BEGIN { skip_all('not perlio') unless (find PerlIO::Layer 'perlio'); # FIXME - more of these could be tested without Encode or full perl skip_all_if_miniperl("no dynamic loading on miniperl, no Encode"); - require Config; Config->import; - skip_all('Encode was not built') - unless ($Config::Config{extensions} =~ /\bEncode\b/); + skip_all_without_extension('Encode'); # Makes testing easier. $ENV{PERLIO} = 'stdio' if exists $ENV{PERLIO} && $ENV{PERLIO} eq ''; @@ -23,6 +21,7 @@ BEGIN { $PERLIO = exists $ENV{PERLIO} ? $ENV{PERLIO} : "(undef)"; } +use Config; my $DOSISH = $^O =~ /^(?:MSWin32|os2|dos|NetWare)$/ ? 1 : 0; $DOSISH = 1 if !$DOSISH and $^O =~ /^uwin/; -- cgit v1.2.1