summaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAgeFilesLines
* Add exceptions to dual-life.tDavid Golden2010-07-191-1/+12
|
* Added t/porting/dual-life.tDavid Golden2010-07-181-0/+29
| | | | | | Because we manually generate Makefiles, any executables need to be generated from .PL files in utils/. This test checks if dual-life executables show up in utils/.
* add CVf_CVGV_RC flagDavid Mitchell2010-07-181-1/+10
| | | | | | | | | | | | | after the recent commit 803f274831f937654d48f8cf0468521cbf8f5dff, the CvGV field is sometimes reference counted. Since it was intended that the reference counting would happen only for anonymous CVs, the CVf_ANON flag was co-opted to indicate whether RC was being used. This is not entirely robust; for example, sub __ANON__ {} is a non-anon sub which points to the same GV used by anon subs, which while itself doesn't directly break things, shows that the potential for breakage is there. So add a separate flag just to indicate the reference count status of the CvGV field.
* Add \o{} escapeKarl Williamson2010-07-174-1/+63
| | | | | | | | | | This commit adds the new construct \o{} to express a character constant by its octal ordinal value, along with ancillary tests and documentation. A function to handle this is added to util.c, and it is called from the 3 parsing places it could occur. The function is a candidate for in-lining, though I doubt that it will ever be used frequently.
* Add tests for \400 for "" strings, s//replacement/Karl Williamson2010-07-172-2/+16
| | | | Signed-off-by: David Golden <dagolden@cpan.org>
* \400 -\777 now means the same thing in all d-quoteKarl Williamson2010-07-172-10/+8
| | | | | | | | | | | | Prior to this patch, \400 - \777 meant something different in some circumstances in regexes outside bracketed character classes. A deprecated warning message has been in place since 5.10.1 when this happens. Remove the warning, and bring the behavior into line with the other double-quotish contexts. \400 - \777 now always means the same thing as \x{100} - \x{1FF} (except when the octal forms are taken as backreferences.) Signed-off-by: David Golden <dagolden@cpan.org>
* Remove extra blanks from t/re/re_tests, vimKarl Williamson2010-07-171-7/+7
| | | | | | | | My vim settings were causing extra blanks in this file; remove the ones I added recently and set the vim options to disable the offending feature. Signed-off-by: David Golden <dagolden@cpan.org>
* Avoid test suite hang with new readline test on VMS.Craig A. Berry2010-07-161-2/+8
|
* [perl #72729] Test appending sv_gets for ascii/utf8 in target and handleJosh ben Jore2010-07-141-1/+49
|
* [perl #72729] TODO for aborted readline() returning '' instead of undefJosh ben Jore2010-07-141-3/+4
|
* protect CvGV weakref with backrefDavid Mitchell2010-07-142-56/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each CV usually has a pointer, CvGV(cv), back to the GV that corresponds to the CV's name (or to *foo::__ANON__ for anon CVs). This pointer wasn't reference counted, to avoid loops. This could leave it dangling if the GV is deleted. We fix this by: For named subs, adding backref magic to the GV, so that when the GV is freed, it can trigger processing the CV's CvGV field. This processing consists of: if it looks like the freeing of the GV is about to trigger freeing of the CV too, set it to NULL; otherwise make it point to *foo::__ANON__ (and set CvAONON(cv)). For anon subs, make CvGV a strong reference, i.e. increment the refcnt of *foo::__ANON__. This doesn't cause a loop, since in this case the __ANON__ glob doesn't point to the CV. This also avoids dangling pointers if someone does an explicit 'delete $foo::{__ANON__}'. Note that there was already some partial protection for CvGV with commit f1c32fec87699aee2eeb638f44135f21217d2127. This worked by anonymising any corresponding CV when freeing a stash or stash entry. This had two drawbacks. First it didn't fix CVs that were anonmous or that weren't currently pointed to by the GV (e.g. after local *foo), and second, it caused *all* CVs to get anonymised during cleanup, even the ones that would have been deleted shortly afterwards anyway. This commit effectively removes that former commit, while reusing a bit of the actual anonymising code.
* protect CvSTASH weakref with backrefsDavid Mitchell2010-07-141-1/+14
| | | | | | | | | | | | | | Each CV usually has a pointer, CvSTASH, back to the stash that it was complied in. This pointer isn't reference counted, to avoid loops. Which can leave it dangling if the stash is deleted. There is already protection for the similar GvSTASH field in GVs: the stash has an array of backrefs, xhv_backreferences, pointing to the GVs whose GvSTASHes point to it, and which is used to zero all the GvSTASH fields should the stash be deleted. All this patch does is also add the CVs with CvSTASH to that stash's backref list too.
* [perl #72729] Test that sv_gets doesn't revive dead stringsJosh ben Jore2010-07-141-1/+85
|
* Add t/op/readline.t docsJosh ben Jore2010-07-141-1/+5
|
* Perl_sv_len_utf8 can use the UTF-8 offset cache to reduce its linear scan.Nicholas Clark2010-07-121-1/+8
| | | | | | Previously, if the scalar's character length wasn't yet known, but an offset midway was, the offset would be ignored, and the linear scan of UTF-8 was for the entire length of the scalar.
* Perl_sv_pos_b2u now calls utf8_mg_len_cache_update for the string end offset.Nicholas Clark2010-07-121-1/+9
| | | | | | Previously it would not take special action if the offset requested happened to be the end of the string, meaning that the (fixed size) UTF-8 offset cache would be used for a value which could (and should) be stored elsewhere.
* Avoid UTF-8 cache panics with offsets beyond the string. Fixes RT #75898.Nicholas Clark2010-07-111-1/+10
| | | | | | Change S_sv_pos_u2b_forwards() to take a point to the (requested) UTF-8 offset, and return the actual UTF-8 offset for the byte position returned. This ensures that the cache is consistent with reality.
* In t/harness, clear PERL5LIB, PERLLIB, PERL5OPT as t/TEST does.Nicholas Clark2010-07-091-13/+13
| | | | | In fact, as t/harness requires t/TEST, simply get t/TEST to do it for t/harness too.
* PATCH: t/lib/common.pl localized $/ setting; allow input 'no_plan'karl williamson (via RT)2010-07-081-2/+8
| | | | | | | | | | | | | | | | | | # New Ticket Created by karl williamson # Please include the string: [perl #76398] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=76398 > See attached patches >From 275169a8df5851331669da2dd791483379c3fc5e Mon Sep 17 00:00:00 2001 From: Karl Williamson <khw@khw-desktop.(none)> Date: Tue, 6 Jul 2010 09:20:42 -0600 Subject: [PATCH] t/lib/common.pl: localize changing $/ $/ changes should not affect callers. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
* Tests for allowing uppercase X/B in hexadecimal/binary numbers (#76296).Bo Lindbergh2010-07-062-4/+26
| | | | Signed-off-by: David Golden <dagolden@cpan.org>
* Ensure new arg to watchdog() in t/test.pl gets initializedJerry D. Hedden2010-07-051-1/+1
|
* Make checkAUTHORS a test to further reduce the release burdenJesse Vincent2010-07-041-0/+19
|
* Make previous test fix conditional on the platform being WindowsRafael Garcia-Suarez2010-07-041-1/+1
|
* Force t/io/openpid.t to use the alarm() watchdog strategy.George Greer2010-07-042-2/+8
| | | | | | | | | | | | | | | * The default watchdog strategy on Win32 doesn't work because the watchdog is executed via subshell ("cmd /c perl -e '...'"). When the test finishes and tries to kill the watchdog all it manages to do is whack cmd.exe and the watchdog still fires, potentially killing an innocent process. * Trying to use the fork() strategy instead causes openpid.t's test #9's "ok" to be lost occasionally. The message itself is generated by the 4th child of the test and should go directly to stdout, but sometimes the output vanishes for unexplained reasons. This doesn't appear to happen without the watchdog enabled. * Using the alarm() watchdog strategy seems to not cause any badness.
* eval $overloaded can crashDavid Mitchell2010-07-031-1/+8
| | | | | | | Perl_lex_start() assumes that the SV passed to it is a well-behaved string that it can do PVX() stuff to. If it's actually a ref to an overloaded object, it can crash and burn. Fixed by creating a stringified copy of the SV if necessary.
* Adjust 'make test.valgrind' to account for cpan/dist/ext separation.George Greer2010-07-032-3/+11
| | | | Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
* t/lib/common.pl can use caller to infer the name of the pragma under test.Nicholas Clark2010-07-011-1/+3
| | | | | | | This avoids needing to use a variable in package main to pass in information. Also, remove an unnecessary $ENV{PERL5LIB} assignment cargo-culted into most users of t/lib/common,pl, and remove the BEGIN block as the code it contained doesn't need to run at BEGIN time.
* Convert subs.t to use t/lib/common.plNicholas Clark2010-07-012-1/+84
|
* Convert charnames.t to use t/lib/common.plNicholas Clark2010-07-012-3/+247
|
* Convert strict.t to use t/lib/common.plNicholas Clark2010-07-011-2/+2
|
* Allow the "diag_listed_as" annotation to work on multi-line function calls.Nicholas Clark2010-06-291-1/+3
| | | | | | Previously it would only work if the comment was on the line immediately preceding the closing /\);/, which was fine for croak()/die()/etc function calls all on one line, but not so useful for longer calls.
* Reinstate require error messages for .h and .phNicholas Clark2010-06-291-0/+35
| | | | | | | | These had been present since 5.000, but were inadvertently removed by the refactoring b8f04b1b779ce1df. Yes, files matching /.*.h\z/ get two pieces of advice in the error message, but this was the exact behaviour pre-b8f04b1b779ce1df.
* In pp_require and code refs in @INC, avoid using memory after free().Nicholas Clark2010-06-291-1/+13
| | | | | | d8723a6a74b2c12e wasn't perfect, as the char * returned by SvPV*() can be a temporary, freed at the next FREETMPS. There is a FREETMPS in pp_require, so move the SvPV*() after it.
* Deprecate no space after s/a/b/ and keywordKarl Williamson2010-06-281-1/+4
| | | | | Pattern replacements need to have the deprecation added; the prior patch on this ticket only changed m/a/keyword; this adds the s/a/b/keyword
* RT 75902: Add prototypes for tie() and untie() to allow overloadingFather Chrysostomos2010-06-251-3/+3
|
* RT #75812: apply get magic before checking flags, PVXTony Cook2010-06-251-1/+8
| | | | | | The code was checking flags with applying any get magic, so when a match was doing putting a numeric string into $1, none of the flags checked were set, so producing the "non-numeric process ID" error.
* In pp_sort, ensure that @_ is freed correctly.Nicholas Clark2010-06-241-1/+38
| | | | Before this, if @_ had become AvREAL(), it retains reference on its elements.
* when disabling regex implicit check string we must reset anchored flagYves Orton2010-06-241-1/+11
| | | | | | | | | | | | | | | | | | | | It seems that if a regex check string is determined to be "not useful" it is permananently disabled. However, it appears that when doing this we dont necessarily reset any flags that are related to it. Worse, the behaviour is not determinisitic, so it is quite possible that a given program may experience this bug "randomly" based on what strings it was matching. Thus it may be difficult to reproduce. Resetting the RXc_ANCH_MBOL when we know that it is implicit (PREGf_IMPLICIT) seems to fix /this/ particular example. But it wouldn't surprise me to discover that other "random" bugs we encounter can be traced back to this behaviour. This fixes RT #75878 which is derived from ActiveState Bug #87173. http://bugs.activestate.com/show_bug.cgi?id=87173 http://rt.perl.org/rt3/Ticket/Display.html?id=75878
* In S_sortcv_stacked(), handle @_ correctly. Fix for #72334.Gerard Goossen2010-06-231-1/+11
| | | | Remove AvREAL from @_, and set AvALLOC when reallocating @_.
* Deprecate no space between pattern, following wordKarl Williamson2010-06-181-1/+4
| | | | | | | This patch raises a deprecated warning on constructs like $result = $a =~ m/$foo/sand $bar; which means $result = $a =~ m/$foo/s and $bar;
* uc(): Handle Greek YPOGEGRAMMENIKarl Williamson2010-06-151-1/+3
| | | | | | | | | | | | | | | | | | | | | Unicode contains two context-sensitive case-changing rules. This patch enables one of them, dealing with the Greek YPOGEGRAMMENI. The code had been #ifdef'd out, so the changes here are more than what the diff shows. The reason it was #ifdef'd out was because more research was needed to verify that it was correct, which I have now done, and think it is. The issue is we may just be uppercasing a portion of the context, so don't have complete knowledge of what should be done. This patch causes us to move the ypogegrammeni to as far right as it should go, or to the end of the context we know about, whichever comes first. That's the best we can do. If it really should be moved further to the right, there's no way we can do it, because the user has not called uc() with the full information needed. So, in all cases, this is better than just leaving it where it was in the input. Also, the applicable context is limited to a logical character, that matched by /\X/, so if the user is calling uc() on a subset of a logical character, it really is their mistake.
* t/uni/case.pl: allow extra tests of different formKarl Williamson2010-06-154-6/+14
| | | | | | Add an option to case.pl so that the callers can run extra tests that don't fit in with it's format. They just pass the number run to it, and it adjusts the plan accordingly.
* Note why pp_tie can't use call_method() for a package name.Nicholas Clark2010-06-141-0/+8
| | | | Plus a test that would fail if it did.
* Better diagnostics on detecting case sensitive file name clashes.Nicholas Clark2010-06-121-1/+2
|
* Revert "make 'local $tied' untied"David Mitchell2010-06-071-28/+1
| | | | | | | | | This reverts commit 191ad7eff570fc96c93993e4358f83e2033365d6. Some modules (e.g. File::chdir) relied on the current behaviour of local $tied_scalar, so lets leave things as-is for now. See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2010-05/msg00627.html
* glob crashes when %File::Glob:: is emptyFather Chrysostomos2010-06-071-2/+10
| | | | | | | | In 5.6.2, a failure to find a CORE::GLOBAL::glob after loading File::Glob would result in a fallback to external glob via pp_glob. Now it crashes. The attached patch should fix this.
* Test the return value of push and unshift.Nicholas Clark2010-06-061-4/+6
|
* Convert tiearray.t to test.pl.Nicholas Clark2010-06-061-117/+55
|
* fix for RT #8438: $tied->() doesn't call FETCHDavid Mitchell2010-06-041-0/+16
| | | | | | pp_entersub checked for ROK *before* calling magic. If the tied scalar already had ROK set (perhaps from a previous time), then get magic (and hence FETCH) wasn't called.
* Avoid overflow warning in chop.t.Craig A. Berry2010-06-041-0/+1
| | | | | It overflows at compile time on 32-bit architectures, so the skip isn't enough.