summaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAgeFilesLines
* Revert "test - Do not run test output at compilation time"v5.27.4John SJ Anderson2017-09-202-67/+33
| | | | | | | This reverts commit d190dde9b72a7c306622389007b0dba86901ce52. Changes in this commit broken `make minitest`, as discovered during the 5.27.4 release process.
* avoid sysread()/syswrite() warnings from the default :utf8 from PERL_UNICODETony Cook2017-09-206-20/+44
| | | | | | | | | | | | In a UTF-8 locale, if the PERL_UNICODE environment variable is set, perl may add a :utf8 layer. v5.23.1-197-gfb10a8a deprecated using sysread(), syswrite() etc on such handles, which meant that a test run under PERL_UNICODE could produce a significant number of deprecation warnings. Prevent those warnings, typically by binmode(), but in one case by disabling the warning.
* (perl #131777) prevent non-'=' assign ops tokens in sub signaturesTony Cook2017-09-192-6/+19
| | | | | | | | | | | | | | | | The yacc grammar introduced in d3d9da4a7 uses ASSIGNOP to represent the '=' used to introduce default values in subroutine signatures, unfortunately the parser returns ASSIGNOP for non-simple assignments, which allowed: sub foo ($x += 1) { ... } to default $x to 1. Modify yylex to accept only the simple assignment operator after a subroutine parameter. I'm not especially happy with the error recovery here.
* Revise tests to account for d_linkat.James E Keenan2017-09-181-0/+2
|
* (perl #127663) work around what appears to be a freebsd bugTony Cook2017-09-181-1/+14
| | | | | renameat() on FreeBSD 11 fails if the paths supplied are absolute paths.
* Revert changes to t/op/threads-dirh.t in 1ce8be81dfaf09bc8a07.James E Keenan2017-09-151-8/+8
| | | | | | They were causing failures on smoke testers running threaded builds on Linux. For: RT #132092
* test - Do not run test output at compilation timeNicolas R2017-09-152-33/+67
| | | | | | | | | | | | | Even if in most of the cases it seems ok to print output during compilation time, this is a pretty bad idea (when compiling the test for example). Run all the tests at compile time, but only print the test status at run time. (Trailing whitespace cleanup by committer.) For: RT # 132092
* test - Do not use B which is a reserved namespaceNicolas R2017-09-153-47/+47
| | | | | | | | | | | | B is already a reserved namespace. This is a bad idea to use B during unit test, as this increase the complexity when using one of the B subpackage to run the test. Simply rename B to BB ( and A to AA ). (Whitesapce cleanup by committer.) For: RT # 132092
* tests - remove useless setting in BEGINNicolas R2017-09-152-10/+1
| | | | | | | | | | These two tests are not using test.pl and do not need to load any special file. No need for fancy setup in BEGIN, all the most we cannot use the generic set_up_inc helper. Simply remove the useless BEGIN block.
* tests - Use set_up_inc helper to set @INCNicolas R2017-09-153-12/+14
| | | | Test plan should not be declared at compile time
* t/run/locale.t: Move function callKarl Williamson2017-09-141-1/+1
| | | | | | I think its better form to call the function after the 'use' statement that imported the function being called, even though it's available throughout the enclosing block.
* Test for 0e3f4440d849cf8fca676f87e574164e33cf2e13Abigail2017-09-141-0/+12
| | | | | | Commit 0e3f4440d849cf8fca676f87e574164e33cf2e13 fixes issue #131868 by silencing a warning which should not happen. This patch checks that the warning is not happening.
* Check for Unicode replacement character in t/porting/podcheck.tDagfinn Ilmari Mannsåker2017-09-111-0/+16
| | | | | | Pod::Simple replaces bytes that aren't valid according to the document's encoding (declared or auto-detected) \N{REPLACEMENT CHARACTER}, so catch that.
* Fix misplaced =back in t/porting/podcheck.tDagfinn Ilmari Mannsåker2017-09-111-2/+2
| | | | | The list of pedantic checks was mistakenly nested inside the last mandatory check.
* (perl #127663) fallback to looking for work file if st_ino unusableTony Cook2017-09-111-1/+1
|
* (perl #127663) reject a changed directory for relative in-place filenamesTony Cook2017-09-111-2/+23
| | | | | based in the inode/device numbers when we don't have the *at() functions.
* (perl #127663) test we fail if the work file can't be renamedTony Cook2017-09-111-4/+34
| | | | and ensure we (attempt to) clean up the work file
* (perl #127663) test we fail if the backup rename failsTony Cook2017-09-111-1/+16
| | | | and that we clean up the temp file
* (perl #127663) clean up any files left behindTony Cook2017-09-111-0/+3
| | | | | The rename work file test will leave the work file, if the other tests fail for some reason they might also leave files.
* (perl #127663) don't do inplace renaming etc in child processesTony Cook2017-09-111-1/+33
| | | | | | | | | | This avoids trying to rename the work file over the original multiple times, which could make the implicit (or explicit) close fail. This is an incompatibility with the pre-workfile version of in-place editing, since you could previously fork a child to do process a given file, but hopefully this is a rare case.
* (perl #127663) don't do inplace renaming etc in child threadsTony Cook2017-09-111-1/+22
| | | | This also avoids double closedir()ing the directory handle.
* (perl #127663) test chdir() within an in-place edit loopTony Cook2017-09-111-1/+23
|
* (perl #127663) test that die/exit leave the original fileTony Cook2017-09-111-3/+27
|
* (perl #127663) add more in-place edit testsTony Cook2017-09-112-2/+73
| | | | | test that setuid is preserved with nested in-place editing, which fails previously.
* (perl #127663) only test renaming directories with rename() available.Tony Cook2017-09-111-11/+16
| | | | | Perl's rename implementation falls back to link() to rename when rename() isn't available, which is either disallowed or dangerous.
* (perl #131665) avoid a buffer overflow in a buffer we didn't needTony Cook2017-09-101-5/+16
| | | | | | | since Lookup() treats its argument as NUL or '=' terminated. Previously environment variable names longer than the size of the buffer would result in a buffer overflow.
* fix #132017 - OPFAIL insert needs to set flags to 0Yves Orton2017-09-101-1/+4
| | | | why reginsert doesnt do this stuff I dont know.
* Teach podcheck about strftime() and localeconv() man pagesKarl Williamson2017-09-091-1/+3
|
* Add unit test t/op/stash_parse_gv.tNicolas R2017-09-051-0/+31
| | | | | | This test add coverage for long function names in order to increase test coverage for S_parse_gv_stash_name function.
* Strengthen weak refs when sorting in-placeDagfinn Ilmari Mannsåker2017-09-041-1/+12
| | | | | | It's conceptually an assignment, which should strengthen any weak refs. Reported-by: Tom Molesworth <team@cpan.org>
* perldelta for 745e740c825dTony Cook2017-08-311-2/+0
| | | | and remove an obsolete comment, oops.
* (perl #128263) handle PL_last_in_gv being &PL_sv_undefTony Cook2017-08-311-1/+11
| | | | | | | | | | | | rv2gv will return &PL_sv_undef when it can't get a GV, previously this could cause an assertion failure in mg.c My original fix for this changed each op that deals with GVs for I/O to set PL_last_in_gv to NULL if there was no io object in the GV, but this changes other behaviour as noted by FatherC. Also partly reverts 84ee769f, which unnecessarily did the same for readline(), so now we're consistent.
* (perl #131949) adjust s in case peekspace() moves the line stringTony Cook2017-08-311-1/+11
|
* [perl #131883] Include pkg in :prototype warningsFather Chrysostomos2017-08-281-2/+8
| | | | | | | | | | | | The subref-in-stash optimisation was causing the package name to be dropped in prototype warnings triggered by the :prototype() attribute syntax, since the GV containing the stash name and the sub name did not exist because of the optimisation. Commit 2eaf799e, which introduced said optimisation, simply did not include the package name in validate_proto’s ‘name’ parameter, but just the sub name. This commit makes it tell validate_proto to use the current stash name.
* Test ‘Missing ']' in prototype’ warningFather Chrysostomos2017-08-281-0/+5
|
* (perl #131836) avoid a use-after-free after parsing a "sub" keywordTony Cook2017-08-281-1/+9
| | | | | | | | | | | | | The: d = skipspace(d); can reallocate linestr in the test case, invalidating s. This would end up in PL_bufptr from the embedded (PL_bufptr = s) in the TOKEN() macro. Assigning s to PL_bufptr and restoring s from PL_bufptr allows lex_next_chunk() to adjust the pointer to the reallocated buffer.
* diag.t needs to know that yywarn implies WARN_SYNTAXFather Chrysostomos2017-08-211-0/+2
| | | | | | because yywarn calls yyerror with PL_in_eval containing the EVAL_WARNONLY flag, and yyerror calls Perl_ck_warner_d(aTHX_ packWARN(WARN_SYNTAX),...) when that flag is set.
* Teach diag.t about Perl_formFather Chrysostomos2017-08-211-1/+1
| | | | | | Some of the error-producing functions are called with Perl_form(...) as the first argument. diag.t did not know about this, and was missing many cases.
* Move illegalproto warnings to t/lib/warning/tokeFather Chrysostomos2017-08-212-61/+58
| | | | The code that produces the warnings is in toke.c, after all.
* (perl #131793) sanely handle PL_linestart > PL_bufptrTony Cook2017-08-171-1/+8
| | | | | | | In the test case, scan_ident() ends up fetching another line (updating PL_linestart), and since in this case we don't successfully parse ${identifier} s (and PL_bufptr) end up being before PL_linestart.
* (perl #124368) make /foo/o; /$null/ act consistentlyTony Cook2017-08-141-1/+16
| | | | | | | | | Previously the /o would be inherited by the second match if the first match was successful, but only on non-threaded builds. The op-tree rewriting done on non-threaded builds could also confuse the interpreter, possibly resulting in the match op receiving the argument intended for the regcomp op.
* (perl #131725) ignore the exponent on a decimal float if no digitsTony Cook2017-08-141-0/+10
| | | | | | | | | | | Previously the "1e-" in "1e--5" would be treated as "1", but consumed the "e-". This wasn't an issue for hex floats. I considered (and implemented) croaking instead, but this was inconsistent with the behaviour for hex floats, which only reach this code if a full hex float has been parsed.
* (perl #131646) make the test less fragileTony Cook2017-08-081-1/+1
| | | | | | | | | | | | | | | | The original pattern "UXp>" with the $_ that causes the failure, 5, so we end up packing exp(5) or 148.... with U packs: - U (148), producing C2 94, with the UTF8 flag set - X - back up a byte, - p> - write the address of PL_sv_no's PV in big-ending The final p> will typically overwrite the 94 with a zero on 64-bit systems, but with the smaller address space of 32-bit systems that high-byte is more likely to be a valid continuation byte, causing the comparison to fail. Instead just pack a zero byte.
* fix index(...) == -1 type optimisationsDavid Mitchell2017-08-072-42/+66
| | | | | | | | | RT #131851 It was incorrectly optimising some permutations of comparison op and 0/-1 which shouldn't have been, such as 0 < index(...);
* t/perf/opcount.t typoDavid Mitchell2017-08-051-1/+1
| | | | fix typo from my recent commit. Spotted by Jarkko.
* extend index(...) == -1 optimisationDavid Mitchell2017-08-052-8/+33
| | | | | | | | | | | | | Recently I made it so that in expression like index(...) == -1, the const and eq ops are optimised away and a BOOL flag is set on the index op. This commit expands this to various permutations of relational ops too, such as index(...) >= 0 index(...) < 0 index(...) <= -1
* t/op/index.t: automate a block of testsDavid Mitchell2017-08-051-59/+33
| | | | | | | | | | | A block of tests I added recently tests that (index(...) == -1) style optimisations don't break things. Each test was hard-coded. Instead, use some nested loops and eval to test all the combinations. This commit does just the same tests as before, but it will allow us to easily add more tests without lots of duplication.
* set SVs_PADTMP flag on PL_sv_zeroDavid Mitchell2017-08-041-1/+13
| | | | | | | | | | | | | | | | | | | Where an op in scalar but not boolean context returns &PL_sv_zero as a more efficient way of doing sv_2mortal(newSViv(0)), the returned value must be mutable. For example my @a = (); my $r = \ scalar grep $_ == 1, @a; $$r += 10; By setting the SVs_PADTMP flag, this forces pp_srefgen() and similar to make a mortal copy of &PL_sv_zero. This kind of defeats the original optimisation, but the copy only kicks in under certain circumstances, whereas the newSViv(0) approach would create a new mortal every time. See RT #78288 for where FC suggested the problem and the solution.
* PVLV-as-REGEXP: avoid PVX double freeDavid Mitchell2017-08-041-1/+17
| | | | | | | | | | | | | | With v5.27.2-30-gdf6b4bd, I changed the way that PVLVs store a regexp value (by making the xpv_len field point to a regexp struct). There was a bug in this, which caused the PVX buffer to be double freed. Several REGEXP SVs can share a PVX buffer. Only one of them will have a non-zero xpv_len field, and that SV gets to free the buffer. After the commit above, the non-zero xpv_len was triggering an extra free. This was showing up in smokes as failures in re/recompile.t when invoked with PERL_DESTRUCT_LEVEL=2 (which t/TEST does).
* make utf8::upgrade() of a REGEXP a NOOPDavid Mitchell2017-08-041-1/+10
| | | | | | | | | | | | | | | | | | RT #131821 After my recent commit v5.27.2-30-gdf6b4bd, "give REGEXP SVs the POK flag again", $r = qr/.../; utf8::upgrade($$r); was setting the utf8 flag on the compiled REGEXP SV, which made no sense, as the regex was already compiled and individual nodes would remain non-utf8. The POK flag was removed from REGEXPs in 5.18.0, but before then it didn't seem to matter if the utf8 flag got set later, but it does now - it broke a Tk test.