summaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAgeFilesLines
* don't taint $$ determined by getpid()Zefram2012-02-251-1/+8
| | | | | | Reading $$ in a tainted expression was tainting the internal sv_setiv() on $$. Since the value being set came directly from getpid(), it's always safe, so override the tainting there. Fixes [perl #109688].
* delay allocating trans table until neededZefram2012-02-251-1/+10
| | | | | | | | | | | | | | | | | | | Previously, a table was being allocated for OP_TRANS(|R), in a PVOP arrangement, as soon as the op was built. However, it wasn't used immediately, and for UTF8-flagged ops it would be thrown away, replaced by an SV-based translation table in a SVOP or PADOP arrangement. This mutation of the op structure occurred in pmtrans(), some time after original op building. If an error occurred before pmtrans(), requiring the op to be freed, op_clear() would be misled by the UTF8 flags into treating the PV as an SV or pad index, causing crashes in the latter case [perl #102858]. op_clear() was implicitly assuming that pmtrans() had been performed, due to lacking any explicit indication of the op's state of construction. Now, the PV table is allocated by pmtrans(), when it's actually going to populate it. The PV doesn't get allocated at all for UTF8-flagged ops. Prior to pmtrans(), the op_pv/op_sv/op_padix field is all bits zero, so there's no problem with freeing the op.
* "no feature" now means reset to defaultRicardo Signes2012-02-221-2/+22
| | | | | | | | | See https://rt.perl.org/rt3/Ticket/Display.html?id=108776 "no feature" now resets to the default feature set. To disable all features (which is likely to be a pretty special-purpose request, since it presumably won't match any named set of semantics) you can now write "no feature ':all'"
* podcheck.t: Typo in podKarl Williamson2012-02-191-1/+1
|
* Make t/porting/authors.t work on WindowsMax Maischein2012-02-191-1/+2
| | | | | | | The Windows shell cmd.exe does not know about single quotes. Double quotes are the only thing available here. This patch selects the kind of quote to use based on the operating system and constructs the pipeline accordingly.
* Add t/porting/pending-author.t, fixing a limitation of t/porting/authors.tNicholas Clark2012-02-181-0/+60
| | | | | | | | | t/porting/pending-author.t attempts to avoid the problem of C<make test> passing 100%, but the subsequent git commit causing F<t/porting/authors.t> to fail, because it uses a "new" e-mail address. This test is only run if one is building inside a git checkout, B<and> one has made local changes. Otherwise it's skipped.
* t/porting/authors.t only needs to pass the Author to checkAUTHORS.plNicholas Clark2012-02-181-1/+1
| | | | | | | | | Commit 3ea0c581844689ab didn't go far enough in pruning the input. When Porting/checkAUTHORS.pl is invoked with --tap it uses parse_commits_from_stdin_authors() instead of parse_commits_from_stdin(), which only looks for lines matching /^Author:/ This reduces runtime by a further 8%.
* Longer filenames for while_readdir.t.Craig A. Berry2012-02-181-1/+1
| | | | | | | | | | | | With filenames varying between only one and five characters in length, it was fairly easy to get two files differing only in case ('A' and 'a', for example). Which on non-case-sensitive file systems could generate a warning at unlink time because it would unlink 'a' and then check for the existence of 'a' and get true because 'A' was still there and indistinguishable from 'a'. So just use longer filenames to make the possibility of collision vanishingly small.
* Test that every function in perlfunc.pod has a summary for Pod::Functions.Nicholas Clark2012-02-181-1/+2
| | | | | Historically Pod::Functions has failed to get updated when functions are added. This should solve that.
* Add t/porting/perlfunc.t so that porting tests catch problems with perlfuncNicholas Clark2012-02-181-0/+29
| | | | | | | | | | | | | Pod::Functions is now generated from pod/perlfunc.pod by ext/Pod-Functions/Functions_pm.PL If it can't parse pod/perlfunc.pod, it will abort, which will cause the build to break. It's really not possible for it to carry on, hence aborting is the only option. However, innocent-seeming changes to documentation shouldn't break the build, and we expect everyone to run (at least) the porting tests, hence this test, to catch such problems before it's too late. To avoid duplicating the parsing logic, we make Functions_pm.PL take a --tap option, to test that all is well.
* For make test, move the 'porting' tests before 'lib', 'ext', 'dist' & 'cpan'Nicholas Clark2012-02-171-2/+4
| | | | | | This makes the order more consistent with test_harness, and moves the "interesting" tests earlier. "interesting", in that these are more likely to spot unexpected problems with the tested changes.
* pp_quote_meta: in locale, quote all UTF-8 Latin1 non-ASCIIKarl Williamson2012-02-151-1/+47
| | | | | | Under locale rules, this commit quotes all non-ASCII Latin1 characters in UTF-8 encoded strings. This provides consistency with this function and other functions, such as lc().
* perl #77654: quotemeta quotes non-ASCII consistentlyKarl Williamson2012-02-151-3/+40
| | | | | | | | | | As described in the pod changes in this commit, this changes quotemeta() to consistenly quote non-ASCII characters when used under unicode_strings. The behavior is changed for these and UTF-8 encoded strings to more closely align with Unicode's recommendations. The end result is that we *could* at some future point start using other characters as metacharacters than the 12 we do now.
* Further eliminate POSIX-emulation under LinuxThreadsÆvar Arnfjörð Bjarmason2012-02-151-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under POSIX threads the getpid() and getppid() functions return the same values across multiple threads, i.e. threads don't have their own PID's. This is not the case under the obsolete LinuxThreads where each thread has a different PID, so getpid() and getppid() will return different values across threads. Ever since the first perl 5.0 we've returned POSIX-consistent semantics for $$, until v5.14.0-251-g0e21945 when the getpid() cache was removed. In 5.8.1 Rafael added further explicit POSIX emulation in perl-5.8.0-133-g4d76a34 [1] by explicitly caching getppid(), so that multiple threads would always return the same value. I don't think all this effort to emulate POSIX sematics is worth it. I think $$ and getppid() are OS-level functions that should always return the same as their C equivalents. I shouldn't have to use a module like Linux::Pid to get the OS version of the return values. This is pretty much a complete non-issue in practice these days, LinuxThreads was a Linux 2.4 thread implementation that nobody maintains anymore[2], all modern Linux distros use NPTL threads which don't suffer from this discrepancy. Debian GNU/kFreeBSD does use LinuxThreads in the 6.0 release, but they too will be moving away from it in future releases, and really, nobody uses Debian GNU/kFreeBSD anyway. This caching makes it unnecessarily tedious to fork an embedded Perl interpreter. When someone that constructs an embedded perl interpreter and forks their application, the fork(2) system call isn't going to run Perl_pp_fork(), and thus the return value of $$ and getppid() doesn't reflect the current process. See [3] for a bug in uWSGI related to this, and Perl::AfterFork on the CPAN for XS code that you need to run after forking a PerlInterpreter unbeknownst to perl. We've already been failing the tests in t/op/getpid.t on these Linux systems that nobody apparently uses, the Debian GNU/kFreeBSD users did notice and filed #96270, this patch fixes that failure by changing the tests to test for different behavior under LinuxThreads, I've tested that this works on my Debian GNU/kFreeBSD 6.0.4 virtual machine. If this change is found to be unacceptable (i.e. we want to continue to emulate POSIX thread semantics for the sake of LinuxThreads) we also need to revert v5.14.0-251-g0e21945, because currently we're only emulating POSIX semantics for getppid(), not getpid(). But I don't think we should do that, both v5.14.0-251-g0e21945 and this commit are awesome. This commit includes a change to embedvar.h made by "make regen_headers". 1. http://www.nntp.perl.org/group/perl.perl5.porters/2002/08/msg64603.html 2. http://pauillac.inria.fr/~xleroy/linuxthreads/ 3. http://projects.unbit.it/uwsgi/ticket/85
* Skip stat.t readability test on VMS.Craig A. Berry2012-02-141-0/+1
| | | | | | | | This new test grants full access on a test file to group and other. Since I'm a member of my own group and everyone is someone, I of course have full access to the file, but the test expects it to be unreadable. If there is a hierarchy in Unix file permissions, it clearly doesn't work the same way as the VMS one.
* perl #110648, single Unicode prop in inverted class not getting invertedKarl Williamson2012-02-141-0/+3
| | | | | | | | | | Commit b6c46382308166d54090e3d8e385710664693ac0 introduced a bug when an inverted bracketed character class consists solely of a Unicode property, that property wasn't getting inverted outside the Latin1 range. This was due to an optimization that should have been disabled for this case.
* regcomp.c: /[[:lower:]]/i should match the same as /\p{Lower}/iKarl Williamson2012-02-111-0/+5
| | | | | | Same for [[:upper:]] and \p{Upper}. These were matching instead all of [[:alpha:]] or \p{Alpha}. What /\p{Lower}/i and /\p{Upper}/i match instead is \p{Cased}, and so that is what these should match.
* reg_posixcc.t: Add tests for \v, \V, \h, \HKarl Williamson2012-02-091-1/+5
|
* regcomp.c: Use compiled-in inversion listsKarl Williamson2012-02-091-1/+2
| | | | | | | | | This uses the compiled inversion lists to generate Posix character classes and things like \v, \s inside bracketed character classes. This paves the way for future optimizations, and fixes the bug which has no formal bug number that /[[:ascii:]]/i matched non-Ascii characters, such as the Kelvin sign, unlike /\p{ascii}/i.
* t/re/re_tests: Add Todo testKarl Williamson2012-02-091-0/+2
| | | | | | This bug was spotted by Tom Christiansen, but no bug report has been written. /[[:ascii:]]/i should match the same set of code points as /\p{ASCII}/i. But it is matching things outside the ASCII range
* README.cygwin now has fewer pod issues, update known_pod_issues.dattonyc/cygnotesTony Cook2012-02-091-1/+1
|
* sync version.pm code with CPANDavid Golden2012-02-051-1/+1
| | | | | | Applied patch from John Peacock, but added whitespace fixes, corrected pod link error and updated known Pod issues to reflect a fix.
* In t/porting/authors.t, correct a typo in the git log format string.Nicholas Clark2012-02-051-1/+1
| | | | | The format added in commit 3ea0c581844689ab had a typo - %cn (committer name) used instead of %ce (committer e-mail).
* Unicode 6.1Karl Williamson2012-02-041-1/+1
| | | | | | This commit delivers the official Unicode character database files for release 6.1, plus the final bits needed to cope with the changes in them from release 6.0, including documentation.
* [perl #109762] Stop !$^V from leakingFather Chrysostomos2012-02-031-1/+3
| | | | by mortalising the temporary SVs.
* Revert "Add IO::Socket::IP 0.08 as dual-life module"Ricardo Signes2012-02-031-1/+0
| | | | This reverts commit 497f7de2d964167330f7260590736e9adb18899c.
* Add IO::Socket::IP 0.08 as dual-life modulePaul Evans2012-02-031-0/+1
| | | | Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
* Add 2 more CPAN mods to known_pod_issues.datFather Chrysostomos2012-02-021-0/+2
|
* make Carp messages match die properlyZefram2012-02-022-33/+33
| | | | | Add dot to end of message from Carp, to match the formatting from CORE::die. The stack trace, coming after the message, is unchanged.
* t/op/method.t: Add tests for subless AUTOLOAD and DESTROYBrian Fraser2012-02-011-1/+17
|
* Move more typemap-related documentation to the typemap doc fileSteffen Mueller2012-02-011-1/+1
| | | | | | Some of the discussion in perlxs was duplicated in perlxstypemap. This also adds several references to the new man page and fixes a few minor nits.
* Pod-Perldoc is now maintained on CPANFlorian Ragwitz2012-01-311-3/+3
|
* podcheck.t: Add commentKarl Williamson2012-01-301-0/+1
|
* stat.t: Use $>, not just $< for skippingFather Chrysostomos2012-01-301-1/+1
| | | | This is the paranoid version of just using $>.
* lc.t: Add tests for previously broken IN_UNI_8_BITKarl Williamson2012-01-291-1/+10
| | | | This adds tests for commit b36bf33f6564c3e9a9ff131f4f3c9980b7a8af15
* pod updates for fc and \FBrian Fraser2012-01-291-1/+0
|
* Implement the fc keyword and the \F string escape.Brian Fraser2012-01-295-9/+422
| | | | | | | | | | | | | | | | | | | | | | Along with the simple_casefolding and full_casefolding features. fc() stands for foldcase, a sort of pseudo case (like lowercase), which is used to implement Unicode casefolding. It maps a string to a form where all case differences are erased, so it's a locale-independent way of checking if two strings are the same, regardless of case. This functionality was, and still is, available through the regular expression engine -- /i matches would use casefolding internally. The fc keyword merely exposes this for easier access. Previously, one could attempt to case-insensitively test two strings for equality by doing lc($a) eq lc($b) But that might get you wrong results, for example in the case of \x{DF}, LATIN SMALL LETTER SHARP S.
* Add the fc keyword in regen/feature.plBrian Fraser2012-01-291-0/+1
| | | | It doesn't do anything yet.
* [perl #109264] ->method(my(...)) forcing lvalue cxFather Chrysostomos2012-01-281-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A simple my($foo,$bar) list is flagged as an lvalue: $ ./perl -Ilib -MO=Concise -e 'my($foo,$bar)' 7 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 6 <@> list vKPM/128 ->7 3 <0> pushmark vM/128 ->4 4 <0> padsv[$foo:1,2] vM/LVINTRO ->5 5 <0> padsv[$bar:1,2] vM/LVINTRO ->6 -e syntax OK That 128 that the list op is the same flag as LVINTRO. When a method call is compiled, the list op for the argument list is itself converted into an entersub op. That LVINTRO flag is never turned off. So foo->bar(my($foo,$bar)) becomes this: $ ./perl -Ilib -MO=Concise -e 'foo->bar(my($foo,$bar))' 9 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 8 <1> entersub[t4] vKMS/LVINTRO,TARG ->9 3 <0> pushmark sM/128 ->4 4 <$> const[PV "foo"] sM/BARE ->5 5 <0> padsv[$foo:1,2] lM/LVINTRO ->6 6 <0> padsv[$bar:1,2] lM/LVINTRO ->7 7 <$> method_named[PV "bar"] ->8 -e syntax OK This was rarely a problem until commit da1dff948 added lvalue check- ing for method calls (a fifth bug fix in that commit not mentioned in the commit message). Calling the method will now result in ‘Can't modify non-lvalue subrou- tine call’ unless the method has the :lvalue attribute. Before that, this would only cause problems with lvalue methods: $ perl -le ' sub clear_queue:lvalue { warn "called"; undef } 3==main->clear_queue(my ($id, $name)) ' called at -e line 2. Can't return undef from lvalue subroutine at -e line 3. Calling it with ($id, $name) was fine, and allowed undef to be returned. Perl_localize in op.c (which is called for my, our and local) calls my() (aka Perl_my_attrs) on the list itself for my or our. Perl_my_attrs was setting flags on the list, not just on its children. So this commit modifies my_attrs not to set any flags on the list op itself. local() was not affected, as it goes through op_lvalue_flags instead of my_attrs, and op_lvalue_flags doesn’t set flags on list ops (I mean ops of type OP_LIST, not listops in general). I added tests for it anyway.
* Fix bug #109206: ANCH_MBOL with while /.*/gYves Orton2012-01-291-1/+13
| | | | | | We had a fencepost error when ANCH_MBOL was enabled that meant we did not "see" matches at the end of string. This fixes the problem and adds tests.
* fix variable not shared warnings coming from the use statement being ↵Yves Orton2012-01-281-2/+4
| | | | executed too early
* Adjust skip counts in t/op/filetest_t.t.Craig A. Berry2012-01-281-3/+3
| | | | | Follow-up to 8db8f6b697e6f, where new tests were added without changing the (implicit) skip count of 1.
* Allow prototypes (_@) and (_%)Rafael Garcia-Suarez2012-01-271-1/+16
| | | | | | Those will be equivalent to (_;@) and (_;%) ; since perlsub already states that the semicolon is redundant before @ and % this is in line with the existing documentation.
* Show test names in outputRafael Garcia-Suarez2012-01-271-5/+5
|
* Allow ${^WARNING_BITS} to turn off lexical warningsFather Chrysostomos2012-01-261-2/+20
| | | | | | | | | | | | | | Various magical modules copy hints from one scope to another. But copying ${^WARNING_BITS} doesn’t always copy the same hints. If lexi- cal warnings are not on at all, ${^WARNING_BITS} returns a different value depending on the current value of $^W. Setting ${^WARNING_BITS} to its own value when $^W is true will stop $^W from being able to control the warnings in the current compilation scope. Setting ${^WARNING_BITS} to its own value when $^W is false causes even default warnings to be suppressed. This commit makes undef a special value that represents the default state, in which $^W controls warnings.
* pat.t: Test that . overloading gets passed qr refFather Chrysostomos2012-01-261-1/+18
| | | | | | This is something that my sample patch in ticked #108780 (for fixing /foo$qr/ under ‘no overloading’) would have broken had it been applied.
* stat.t: Skip test when running as rootRainer Tammer2012-01-261-0/+1
|
* Correctly escape UTF-8 in hash keys in uninitialized warningsRafael Garcia-Suarez2012-01-251-2/+2
|
* Update known_pod_issues.dat for x2p/psedChris 'BinGOs' Williams2012-01-251-0/+1
|
* Revert "Regen known_pod_issues.dat"Chris 'BinGOs' Williams2012-01-251-11/+0
| | | | | | This reverts commit 5fa409a90f64110c5708f7141b376e9bdc54fbe2. Resolved by update of Pod-Parser to version 1.51