summaryrefslogtreecommitdiff
path: root/t/loc_tools.pl
Commit message (Collapse)AuthorAgeFilesLines
* loc_tools.pl: Always do normalized locale name checkKarl Williamson2022-12-241-1/+2
| | | | | | Because of variances in capitalization and use of dashes, we should only compare locale names that have been normalized to a common syntax. This was the remaining outlier, and caused issues on some platforms.
* loc_tools.pl: Accept dashless UTF8 besides to 'UTF-8'Karl Williamson2022-12-221-1/+1
| | | | The dash is sometimes omitted
* locales: Add LC_NAME capabilitiesKarl Williamson2022-12-061-1/+1
| | | | | | | | | | | | | LC_NAME is a GNU extension that Perl hadn't been aware of. The consequences were that it couldn't be set or queried in Perl (except by using LC_ALL to set everything). There are other GNU extensions that Perl has long known about; this was the only missing one. The values associated with this category are retrievable by the glibc call nl_langinfo(3) in XS code. The standard-specified items are retrievable from pure Perl via I18N::Langinfo, but it doesn't know only about any of the non-standard ones, including the ones for this category.
* Avoid use of Vietnamese UTF-8 locale on SolarisKarl Williamson2022-12-051-1/+2
| | | | | | | | | | | | | | | | | | On OmniOS r151042 (based on Solaris) the 'strfxm_l' function segfaults when: - LC_COLLATE_MASK is set to 'vi_VN.UTF-8' - the input contains "\xA8" Other locales and other characters appear to be unaffected. This commit causes 'loc_tools.pl' to not return this locale as being acceptable when asked for a list of them. Thus, our automated locale testing will avoid it. A Perl program can still switch into it explicitly. This issue is tracked by #20578, which includes a C-only reproducer not involving Perl.
* loc_tools.pl: Add ability to skip known bad localesKarl Williamson2022-12-051-0/+9
| | | | | | | Some platforms have locales that shouldn't be used. This adds code to avoid using such when looking at all the locales on a platform. The next commit will add the first use.
* loc_tools.pl: Add sub to classify locales UTF-8 vs nonKarl Williamson2022-11-291-14/+30
| | | | | | The new sub taks a list of locales available on the platform and separates the UTF-8 ones from the non-UTF-8 ones, returning two sub-lists
* t/loc_tools.pl: Turn off warnings in a timely mannerKarl Williamson2022-08-181-1/+1
| | | | | It doesn't matter much, but some warnings might be output by doing the 'use locale' before turning off warnings.
* t/loc_tools.pl: White-space onlyKarl Williamson2022-08-181-2/+4
|
* t/loc_tools.pl: Check for unsupported localesKarl Williamson2022-08-181-0/+4
| | | | | | | | This commit causes us not to view unsupported locales as legitimate for testing. Core dumps occurred on some platforms without this. It looks for a diagnostic that the next commit in this series will generate.
* t/loc_tools.pl: Don't allow commas in locale namesKarl Williamson2022-08-181-0/+5
| | | | | | | | | This is a problem in some buggy Windows versions. A Macedonian sub-locale has a comma in its returned name, and Windows can't parse its own name. This addition keeps locales with this bug from being tested, as the XPG standard doesn't allow them.
* t/loc_tools.pl: Add checksKarl Williamson2022-08-181-1/+7
| | | | | | This verifies that we can restore a locale that we were previously in, and makes sure that we don't stay in a locale that doesn't work well. Doing so has led to crashes.
* t/loc_tools.pl: Fail earlierKarl Williamson2022-08-181-5/+9
| | | | | Move the code that returns failure into the loop, so won't keep iterating if failure is going to happen anyway.
* t/loc_tools.pl: Refactor _trylocale()Karl Williamson2022-08-181-32/+31
| | | | | | | This function is used to see if a locale actually works on the current platform. I was not fully aware of the glitches if a category is in one locale, and LC_CTYPE is in another. This makes sure they are both the same; and this results in some simplification.
* t/loc_tools.pl: Print better failing test numbersKarl Williamson2022-08-181-4/+7
| | | | | | | | | This test module is 'required' from other perl test files. If it encounters an error, it doesn't know how to report it. What it does is call fail() if available, and a home-grown one otherwise. Prior to this commit the home-grown version just made all tests number 0. This commit changes that to make them sequentially numbered from a very high starting one, so as not to interfere with the outer calls.
* loc_tools.pl: Move code in fileKarl Williamson2022-08-181-13/+13
| | | | This is for future commits to call after it is defined
* loc_tools: Create function, refactorKarl Williamson2022-08-181-6/+14
| | | | | | | | | category_excluded() is a better name for what the current name 'is_category_valid" does. And it turns out that we need to use this function on (those few) systems that don't have LC_CTYPE to avoid executing code that depends on LC_CTYPE. And we do need an improved is_category_valid() for other checks.
* t/loc_tools.pl: Skip locale tests on z/OS threadedKarl Williamson2022-03-281-0/+1
| | | | | | setlocale() is a no-op on this system after the first thread is created, making it an outlier of platforms, so the tests assume otherwise, hence would fail.
* Remove AT&T UWIN supportDagfinn Ilmari Mannsåker2021-11-021-3/+0
| | | | | UWIN is a UNIX compatibility layer for Windows. It was last released in 2012 and has been superseded by Cygwin these days.
* Remove NetWare supportDagfinn Ilmari Mannsåker2021-10-081-1/+1
| | | | The build has been broken since 2009.
* loc_tools.pl: Fix valid_categories calculationKarl Williamson2021-03-171-3/+11
| | | | | This function was returning the locale categories known to the platform; it should exclude those that perl has been compiled to ignore.
* t/loc_tools.pl: Sort ourselves, instead of requring itKarl Williamson2021-02-111-5/+25
| | | | Instead of demanding the input be sorted, do it ourselves.
* t/loc_tools.pl: Rmv redundant 'if'Karl Williamson2021-02-111-1/+1
|
* loc_tools.pl: Simplify an expressionKarl Williamson2020-11-161-1/+2
| | | | Suggested by Graham Knop
* don't read DATA when it is closedTony Cook2020-11-031-1/+3
| | | | | This has been producing noise for a while, but some recent change meant it started some warning tests failing.
* loc_tools.pl: use 'warnings'Karl Williamson2020-10-301-0/+1
|
* loc_tools.pl: Fix locales_enabled()Karl Williamson2020-10-301-21/+35
| | | | | | | This commit properly returns the new list it is supposed to, clarifies the documentation. Fixes GH #18245
* t/loc_tools.pl: Don't destroy caller's arrayKarl Williamson2020-10-301-24/+24
| | | | | This changes to make a copy of the input array, which can then be modified without affecting the caller.
* t/loc_tools.pl: Consider thread 0 always locale-safeKarl Williamson2020-10-231-2/+7
| | | | | | | | | | | Test files call this code to see if locales are enabled. Prior to this commit, it returned that they were disabled on builds where there are possible races between threads. This was to silence some rarely occurring smoke failures. But that had the result that such builds didn't get locales tested at all, even if there was just a single thread operating. This commit changes it so that when called from other than the main thread on such a system, it returns disabled, but enabled for the main thread.
* t/loc_tools.pl: Don't test unsafe localesKarl Williamson2020-07-171-0/+4
| | | | | Under threads, locales may or may not be safe to use. Skip the testing of them when unsafe.
* Add z/OS locale categoriesKarl Williamson2020-07-171-1/+2
| | | | | | | z/OS has two locale categories, LC_SYNTAX and LC_TOD, not found outside IBM products. This makes Perl know about them, so that a program can refer to them, but like other similar categories found on other OS's, nothing more is done with them.
* Fix a bunch of repeated-word typosDagfinn Ilmari Mannsåker2020-05-221-1/+1
| | | | | Mostly in comments and docs, but some in diagnostic messages and one case of 'or die die'.
* t/loc_tools.pl: Silence 'undef' warningKarl Williamson2019-11-271-1/+1
|
* avoid synthesizing locale names with newlines in themTony Cook2019-07-231-0/+1
| | | | | | | | | | | | | | | | | | while debugging some strange behaviour on Win32 I tried dumping locale names in _trylocale() and saw names go past like: sv_fi.15 <-- newline added at the end sv_fi.15 .UTF-8 sv_fi.15 .65001 sv_fi.15 .ACP sv_fi.15 .OCP sv_fi.15 .1252
* PATCH: [perl #134117] Close DATA in loc_tools.plRichard Leach2019-05-241-1/+1
| | | | This prevents unexpected text in lib/warnings.t
* t/loc_tools.pl: No setlocale when no localesKarl Williamson2019-04-131-0/+2
| | | | | Don't call this function unconditionally. There may be no locale handling available, so check that first.
* t/loc_tools.pl: miniperl can't use locale handlingKarl Williamson2019-04-131-0/+4
| | | | | | | Assume there is no locale handling on this system in the function locales_enabled() if we are operating (as in minitest) without the boot loader, as they can't be accessed because the POSIX module which contains setlocale() can't be loaded.
* Use POSIX locale functions if setlocale not availableKarl Williamson2019-03-061-5/+10
| | | | | | POSIX 2008 added an independent set of locale handling functions beyond the venerable setlocale. This commit changes so they can be used rather than have no locale handling if there is, say, a problem with setlocale.
* Properly handle systems with crippled localesKarl Williamson2019-03-041-15/+12
| | | | | | | | | | | | | | Some systems fake their locales, so that they pretend to accept a locale change, but they either do nothing, making everything the C locale, or on some systems there is a a second locale "C-UTF-8" that can be switched to. Configure probes have been added to find such systems, and this commit changes to use the results of these probes, so that we don't try looking for other locales (any names we came up with would be accepted as valid, but don't work, and tests were failing as a result). Anything running the musl library fits, as does OpenBSD and its kin, as they view locales as security risks. This commit allows us to take out some code that was looking for particular OS's.
* t/loc_tools.pl: Only try C.UTF-8 if Configure says availKarl Williamson2019-03-041-1/+5
| | | | | I added a Configure probe for this capability, since some platforms will say yes to any locale name, so we can't really test for it in perl.
* t/loc_tools.pl: C.UTF-8 is a likely localeKarl Williamson2019-02-061-0/+1
| | | | | When looking for locales on a system, try this one which seems to be getting to be available widely.
* t/loc_tools.pl: Add functions to find Turkic UTF-8 localesKarl Williamson2019-02-051-2/+37
| | | | | | These will be used by later commits. But right now Perl doesn't know how to determine if a locale is Turkic, so these functions return no locale, until later in this commit series
* t/loc_tools.pl: Add fcn to return all UTF-8 localesKarl Williamson2019-02-041-3/+21
| | | | This will be needed in future commits
* t/loc_tools.pl: Special case openbsdKarl Williamson2018-04-171-2/+17
| | | | | | The openbsd setlocale() doesn't behave at all like what one would expect from that function. The comments added in this commit give some details.
* loc_tools.pl: Properly exclude iffy localesKarl Williamson2018-03-041-1/+1
| | | | | | | This code (fragiley) uses the wording of a warning message to determine if a locale has issues or not. Commit 578a6a873a320fe64743b060dbd467f1865d205c updated the message this is looking for, but failed to update this file correspondingly.
* t/loc_tools.pl: Add fcn to return valid locale catsKarl Williamson2018-03-041-5/+20
| | | | | This new function will return the locale categories known to this platform.
* t/loc_tools.pl: 8859-16 is legit; 8859-0 isn'tKarl Williamson2018-02-241-1/+1
| | | | | | This adjusts the loop boundaries looking for come common locale names. It was failing to look for 8859-16; instead looking for latin0, 8859-0, which don't exist
* t/loc_tools.pl: Consider recently added warningKarl Williamson2018-02-241-1/+4
| | | | | | | | | This file has functions that look for and return the valid locales on the current system. A new incompatibility was discovered and a warning generated for in 8b7358b96caf71db3213a7d72fc401e42ee0b2d. This file should have been updated at that time to look for that message to mean it the locale is not compatible. This commit updates it.
* Forbid 'pig' localeKarl Williamson2018-01-301-0/+4
| | | | | This is a toy locale found on some systems, which isn't fully implemented, and if one tries to switch to it can cause failures.
* loc_tools.pl: untaint _source_location's return value and fix a warningTomasz Konojacki2018-01-201-2/+4
| | | | | | | | | Some of our tests are running with -T and it turns out that something in File::Spec::Unix is the tainting the return value of _source_location(). Additionally, when warnings are enabled globally (with either $^W or -W), not passing the last argument (filename) to File::Spec->catpath results in an undefined variable warning.
* loc_tools.pl: properly load fallback localesTomasz Konojacki2018-01-101-2/+16
| | | | | | | | | | | It turns out that some tests using loc_tools.pl are being executed from a different working directory than './t', which causes do("./lib/locale/<locale>") to fail. This fixes lib/warnings.t on Windows. Discussion: https://www.nntp.perl.org/group/perl.perl5.porters/2018/01/msg248652.html