diff options
author | Karl Williamson <khw@cpan.org> | 2015-10-20 21:40:36 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-11-20 10:53:26 -0700 |
commit | 629eeaee7130c432818fc6c21e37be80dc55dd48 (patch) | |
tree | b4300f5a8ea45955ba154494428e9397bb67f0fc /ext/re | |
parent | 467a667a478081da892b51bc98585434c22c3069 (diff) | |
download | perl-629eeaee7130c432818fc6c21e37be80dc55dd48.tar.gz |
Various tests: use centralized locale detection
These tests were using individually defined heuristics to decide whether
to do locale testing or not. However t/loc_tools.pl provides functions
that are more reliable and complete for determining this than the
hand-rolled ones in these tests.
Diffstat (limited to 'ext/re')
-rw-r--r-- | ext/re/t/re_funcs_u.t | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/re/t/re_funcs_u.t b/ext/re/t/re_funcs_u.t index 781ffc9706..70820df3c3 100644 --- a/ext/re/t/re_funcs_u.t +++ b/ext/re/t/re_funcs_u.t @@ -6,7 +6,8 @@ BEGIN { print "1..0 # Skip -- Perl configured without re module\n"; exit 0; } - require 'test.pl'; # For watchdog + require 'test.pl'; # For watchdog + require 'loc_tools.pl'; # To see if platform has locales } use strict; @@ -92,8 +93,7 @@ if ('1234'=~/(?:(?<A>\d)|(?<C>!))(?<B>\d)(?<A>\d)(?<B>\d)/){ } SKIP: { - skip_if_miniperl("no dynamic loading on miniperl, no POSIX", 3); - skip 'No locale testing without d_setlocale', 3 if(!$Config::Config{d_setlocale}); + skip 'No locales available', 3 unless locales_enabled('LC_CTYPE'); require POSIX; my $current_locale = POSIX::setlocale( &POSIX::LC_CTYPE, 'de_DE.ISO-8859-1' ); if ( !$current_locale || $current_locale ne 'de_DE.ISO-8859-1' ) { @@ -109,8 +109,7 @@ if ('1234'=~/(?:(?<A>\d)|(?<C>!))(?<B>\d)(?<A>\d)(?<B>\d)/){ } SKIP: { - skip_if_miniperl("no dynamic loading on miniperl, no POSIX", 3); - skip 'No locale testing without d_setlocale', 3 if(!$Config::Config{d_setlocale}); + skip 'No locales available', 3 unless locales_enabled('LC_CTYPE'); require POSIX; my $current_locale = POSIX::setlocale( &POSIX::LC_CTYPE, 'C' ); if ( !$current_locale || $current_locale ne 'C' ) { |