summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* XS-APItest - add tests for new API calls and for bool internalsYves Orton2022-05-274-2/+107
| | | | | | We do not have any tests for the bool internals. This creates a bunch of them to test and validate the various new API calls for creating and setting bools.
* POSIX.pod: Use proper hyperlinkKarl Williamson2022-05-041-1/+1
|
* Amiga-Exec/Exec.pm: Fix podKarl Williamson2022-05-041-3/+3
| | | | | This line has a syntax error in it. Fix it, and split into two lines so doesn't wrap on output in an 80 column terminal window
* for my ($x) ...: fix handling of degenerate 1-varDavid Mitchell2022-04-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new for my ($x,$y,...) (...) { ... } syntax has a couple of problems in the degenerate case of a single variable: for my ($x) (...) { ... } First, the loop variable is marked as lexical, but not as a variable to be introduced. So it behaves roughly as if written like: { my $x; for $x (...) { ... } } I can't think of any user-visible runtime change in behaviour this bug causes, so I haven't included a test for it. Second, it was being incorrectly deparsed as for $x (...) { ... } (i.e. without the 'my'). This commit fixes both of these issues. The basic problem is that the parser, in the case of multiple vars, passes a list subtree of PADSVs as the 'sv' argument of Perl_newFOROP, but in the case of a single var, passes a single PADSV op instead. This single PADSV doesn't have the LVINTRO flag set, so is indistinguishable from plain my $x; for $x .... This commit makes the parser set the OPf_PARENS flag on the lone PADSV to signal to newFOROP() that it's a degenerate 1-var list, and newFOROP() sets the OPf_PARENS flag on the ENTERITER op to signal to the deparser that this is "for my (...)" syntax, even if it only has a single var.
* re.pm - add notes that the debug output is NOT a "supported API".Yves Orton2022-04-131-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | The debug output leaks a large amount of information about the implementation details of the regex engine and as such is highly likely to change based on almost any change to the regex engine. Also from time to time we make changes to the output to improve legibility, etc. While the output of C<use re 'debug'> is intended for user consumption as well as for debugging the regex engine itself I believe that we should not provide any backcompat guarantees about its specific contents or format. Similarly the list of options we provide for C<use re 'Debug'> may be affected by changes in the internals of the engine, rending old categories irrelevant, or requiring new categories to be added. This patch adds language to the C<re.pm> docs that stipulate that the debug options we provide under C<use re 'Debug'> and the output we provide from C<use re 'debug'> and C<use re 'Debug'> are subject to change without notice at any major or minor release. While I do not anticipate changes to the output in a minor release I believe it is wise to specify that we do not commit ourselves to consistency in this regard in any way. For instance were the situation to arise that we had a security issue or serious performance issues or some other strong justification to make a change in a minor release then this could very well change the output we provide or the options we support.
* gdbm: make sure basic error codes are always definedSergey Poznyakoff2022-04-101-1/+6
| | | | | | | | * ext/GDBM_File/Makefile.PL: Don't protect basic error codes by ifdefs: they are not macros in recent versions of GDBM. Besides, they are known to exist in any GDBM version. For: https://github.com/Perl/perl5/pull/19602
* ext/Devel-Peek/t/Peek.t - cater for doubledouble where neededsisyphus2022-04-081-6/+37
|
* APItest/t/sv_streq.t: Generalize for EBCDICKarl Williamson2022-03-261-7/+7
| | | | | | | | This test fails on EBCDIC systems, because it wants a non-ASCII character, and the one it chose, E9, is ASCII on EBCDIC ('Z'). perlhacktips suggests B6 as a character to use in such tests, and this commit changes to use that.
* Devel::Peek::Peek.t: Simplify EBCDIC handlingKarl Williamson2022-03-261-48/+27
| | | | | | | | | | | | | | The prior commit shows what can happen when two branches do the same thing: they can get out of sync Since this test file was originally written, the testing infrastructure has improved so that there are functions that handle the gory details of character set differences for you. This test file hadn't been updated since it wasn't causing a problem, until now. This commit changes to use the new infrastructure, and as a result one branch gets removed each from the two tests that varied depending on character set.
* Devel::Peek::Peek.t: Add missing '\' for EBCDICKarl Williamson2022-03-261-1/+1
| | | | | This file was recently changed, and the EBCDIC side of the change had a typo.
* Add tests for increased NV precision in Devel::Peek::DumpTAKAI Kousuke2022-03-091-0/+23
|
* Rename is{bool,weak} to is_{bool,weak}Paul "LeoNerd" Evans2022-03-071-3/+3
|
* Add test for the previous commit fixing Perl_my_strtodTAKAI Kousuke2022-03-052-0/+31
| | | | Perl core itself seems not to call my_strtod, so test it with XS::APItest.
* gh19010: simplify and expand inf/nan testsHugo van der Sanden2022-03-041-30/+36
| | | | | | We know how grok results should vary with and without PERL_SCAN_TRAILING both for inputs with trailing garbage and those without, so abstract that out and test both cases for each input.
* gh19010: fix returns for Perl_grok_infnanHugo van der Sanden2022-03-041-7/+10
| | | | | | | | | | | | | | | Consistently honour what the docs have always promised: If an infinity or a not-a-number is recognized, C<*sp> will point to one byte past the end of the recognized string. If the recognition fails, zero is returned, and C<*sp> will not move. Additionally, restore Perl_grok_number_flags to allowing inf/nan with trailing garbage only when called with PERL_SCAN_TRAILING; add notes to the other two core callers to clarify that they always accept such trailing garbage. A small number of XS-APItest tests were modified to reflect the stricter behaviour: "Infin" and "nanx" are now invalid without PERL_SCAN_TRAILING.
* Make sv_dump() (and Devel::Peek) escape PV contents with hex, not octal.Felipe Gasper2022-03-041-6/+6
| | | | | | This improves the readability of SV dumps for those more familiar with hex than octal--which, in 2022, is probably an outsized majority of programmers.
* Correct one spelling errorJames E Keenan2022-03-022-59/+59
| | | | | | Eliminate hard tabs and trailing whitespace from two files. Increment $VERSION.
* Fix UTF8_IS_REPLACEMENT() and add testsKarl Williamson2022-03-013-1/+17
| | | | | | | This macro relied on a now-removed other macro in 2019, 216dc346ceeeb9b6ba0fdd470ccfe4f8b2a286c4. Fix it and add tests. This bug was caught by Devel::PPPort
* regcomp.c,re.pm: Remove "offsets" debugging codeYves Orton2022-02-183-44/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was added by Mark Jason Dominus to aid a regex debugger he wrote for ActiveState. The basic premise is that every opcode in a regex can be attributed back to a contiguous sequence of characters that make up the pattern. This assumption has not been true ever since the "jump" TRIE optimizations were added to the engine. I spoke to MJD many years ago about whether it was ok to remove this from the regex engine and he said he had no objections. An example of a pattern that cannot be handled correctly by this logic is /(?: a x+ | b y+ | c z+ )/x where the (?:a ... | b ... | c ...) parts will now be handled by the TRIE logic and not by the BRANCH/EXACT opcodes that it would have been in the past. The offset debug output cannot handle this type of transformation, and produce nonsense output that mention opcodes that have been optimized away from the final program. The regex compiler is complicated enough without having to maintain this logic. There are essentially no tests for it, and the few tests that do cover it do so as a byproduct of testing other things. Despite the offsets logic only being used in debug supporting it does have a cost to non-debug logic as various internal routines include parameters related to it that are otherwise unused. Note this output is only usable or visible by enabling special flags in re.pm, there is no formal API to access it short of parsing the output of the debug mode of the regex engine, which has changed multiple time over the past years.
* Document Hash::Util::hash_value($string, $seed)Christopher Yeleighton2022-02-171-7/+19
| | | | Returns the hash value as if computed with a different seed.
* POSIX.pod: wording fix in the description of testing NaN-nessTAKAI Kousuke2022-02-151-1/+1
| | | | Equality operators test equality, not equivalence.
* POSIX.pod: add link and small example for the description for NaN-ness testTAKAI Kousuke2022-02-151-2/+3
|
* POSIX.pod: NaN-ness should be able to be tested by "=="TAKAI Kousuke2022-02-151-1/+1
| | | | | A note in the description of "isnan" used to say that NaN-ness cannot be tested with equality operator, but it should be possible.
* Also document and unit-test the correct handling of UTF-8Paul "LeoNerd" Evans2022-01-271-2/+16
|
* Slight tidying of testsPaul "LeoNerd" Evans2022-01-272-6/+8
|
* Create sv_streq() API family, as a stringy copy of the sv_numeq() onesPaul "LeoNerd" Evans2022-01-272-0/+43
|
* Have sv_numeq() respect == overloading unless the SV_SKIP_OVERLOAD flag is ↵Paul "LeoNerd" Evans2022-01-262-2/+16
| | | | passed
* Initial implementation of sv_numeq() and _flags() variantPaul "LeoNerd" Evans2022-01-264-1/+33
|
* Fix bundled .pm files for experimental::builtin warningsPaul "LeoNerd" Evans2022-01-252-2/+4
|
* Fix unit tests for experimental::builtin warningsPaul "LeoNerd" Evans2022-01-254-0/+4
|
* Add ceil & floor to builtinJames Raspass2022-01-241-2/+3
|
* z/OS ASCII Enablement: Manage untagged header errno.h by copy & tagMike Fulton2022-01-181-2/+6
| | | | | | | The system headers on z/OS are in EBCDIC, but are untagged. The bi-modal build requires that files be tagged correctly so this patch copies the errno.h file (which may be mounted on a read-only file system) to a local file and then tags it as IBM-1047 (EBCDIC) so that it can be processed properly. The longer-term fix for this may be to have z/OS tag header files as EBCDIC, although this would not be something Perl could rely on for several years.
* Pod::Html: improve all testsMichiel Beijen2022-01-0419-62/+61
| | | | | | | "use warnings;" in all tests. Remove emacs identifiers. Change tabs to spaces in tests. For: https://github.com/Perl/perl5/pull/19304
* Hash::Util::FieldHash: improve test suiteMichiel Beijen2022-01-048-89/+52
| | | | | | | | | - do not count tests: - use done_testing - put tests requiring threading in their own subtests so we can skip_all - smaller improvements: use strict & warnings everywhere, tabs >> spaces
* Replace bareword filehandle with a lexical scalar:Sawyer X2021-12-281-9/+11
| | | | | | | | | Bareword filehandles are bad and this module should really remove this one. I'm also bumping the version to a stable one because why not. For: https://github.com/Perl/perl5/pull/19302
* Change pack U behavior for EBCDICKarl Williamson2021-12-281-2/+0
| | | | | | | | | | This effectively reverts 3ece276e6c0. It turns out this was a bad idea to make U mean the non-native official Unicode code points. It may seem to make sense to do so, but broke multiple CPAN modules which were using U the previous way. This commit has no effect on ASCII-platform functioning.
* use is_deeply instead of eq_ Test::More functionsMichiel Beijen2021-12-244-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the eq_set, eq_hash, and eq_array functions in Test::More are discouraged to use, and is_deeply is recommended. Ref: https://metacpan.org/pod/Test::More#Discouraged-comparison-functions The reason for this is that, if the tests fail, is_deeply has much better diagnostics. The other thing is that is_deeply is a test function directly, where eq_hash and such need to be wrapped inside ok(). This is easy to forget -- proof of this is in Benchmark.t, where we had this code, that did not test anything: eq_set([keys %$got], [qw(Foo Bar Baz)], 'should be exactly three objects'); It is now replaced by: is_deeply([sort keys %$got], [sort qw(Foo Bar Baz)], 'should be exactly three objects'); this commit replaces all usage of eq_set, eq_hash, and eq_array in lib/ and ext/ for tests that use Test::More. One small exception is where a negated test is used; Test::More does not have is_not_deeply() or such. Test2 has `isnt()` for this, but that is not in core. In those cases, we still keep using the eq_ operators.
* Add last-resort implementation for POSIX::FLT_ROUNDS.TAKAI Kousuke2021-12-242-1/+72
| | | | | | | | POSIX::FLT_ROUNDS now emulates (more) standard behavior that reflects the current rounding mode set by fesetround(), even when compiled with GCC whose FLT_ROUNDS is wrongly fixed to 1. Also add tests for this.
* POSIX: FLT_ROUNDS is now an XS function rather than a constantTAKAI Kousuke2021-12-243-4/+25
| | | | | | POSIX::FLT_ROUNDS used to be an NV constant, but C FLT_ROUNDS is actually an integer and not a constant (C99 seems to say that it reflects the current rounding mode set by fesetround()).
* Bump version number of ext/POSIXKarl Williamson2021-12-241-1/+1
|
* Use builtin::reftype in ext/Paul "LeoNerd" Evans2021-12-142-4/+4
|
* Use builtin::reftype/refaddr in .t filesPaul "LeoNerd" Evans2021-12-082-11/+6
|
* Use builtin::weaken() in .t files in lib/ + ext/Paul "LeoNerd" Evans2021-12-083-3/+2
|
* Add builtin::blessed, refaddr and reftypePaul "LeoNerd" Evans2021-12-081-0/+1
|
* Add builtin:: funcs for handling weakrefsPaul "LeoNerd" Evans2021-12-041-0/+1
| | | | | Also, ensure that B::Deparse understands the OA_TARGMY optimisation of OP_ISBOOL
* Direct optree implementations of builtin:: functionsPaul "LeoNerd" Evans2021-12-011-1/+3
| | | | | | Turn builtin::true/false into OP_CONSTs Add a dedicated OP_ISBOOL, make an efficient op version of builtin::isbool()
* Remove AT&T UWIN supportDagfinn Ilmari Mannsåker2021-11-023-5/+4
| | | | | UWIN is a UNIX compatibility layer for Windows. It was last released in 2012 and has been superseded by Cygwin these days.
* Remove DOS/DJGPP supportDagfinn Ilmari Mannsåker2021-11-027-13/+10
| | | | | | DJGPP is a port of the GNU toolchain to 32-bit x86 systems running DOS. The last known attempt to build Perl on it was on 5.20, which only got as far as building miniperl.
* bump $GDBM_File::VERSIONTony Cook2021-11-021-1/+1
|
* gdbm: Define error codes; provide the global $gdbm_errno variable.Sergey Poznyakoff2021-11-023-11/+284
| | | | | | | | | | | * ext/GDBM_File/GDBM_File.pm: Export gdbm error codes. Improve documentation. * ext/GDBM_File/GDBM_File.xs (BOOT): Define the GDBM_File::gdbm_errno variable. (gdbm_errno): Return a value usable both in numeric and string contexts. * ext/GDBM_File/Makefile.PL: Define gdbm error codes. * Document GDBM_* constants used with tie().