From 629eeaee7130c432818fc6c21e37be80dc55dd48 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 20 Oct 2015 21:40:36 -0600 Subject: 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. --- ext/re/t/re_funcs_u.t | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ext/re') 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'=~/(?:(?\d)|(?!))(?\d)(?\d)(?\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'=~/(?:(?\d)|(?!))(?\d)(?\d)(?\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' ) { -- cgit v1.2.1