summaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAgeFilesLines
* Add tests for the usage messages for Tie::Hash::NamedCapture::*Nicholas Clark2010-10-131-1/+18
|
* In reg_nc_tie.t, use like() to get better diagnostics on failure.Nicholas Clark2010-10-131-3/+3
|
* [perl #78362] Make mro_package_moved check for recursionFather Chrysostomos2010-10-121-1/+8
| | | | | The existence of main::main::... caused mro_package_moved to break Text::Template, and probably Acme::Meta as well.
* Reset isa caches on nonexistent substashes when stash trees are movedFather Chrysostomos2010-10-121-1/+44
| | | | | | | | | | | | | | | | | This fixes the problem of isa cache linearisations’ and method caches’ not being reset on nonexistent packages when they are replaced with real packages as a result of parent stashes’ being moved. This can happen in cases like this: @left::ISA = 'outer::inner'; @right::ISA = 'clone::inner'; {package outer::inner} *clone:: = \%outer::; print "ok 1", "\n" if left->isa("clone::inner"); print "ok 2", "\n" if right->isa("outer::inner"); This changes mro_package_moved’s parameter list as documented in the diff for mro.c. See also the new comments in that function.
* Add an inheritance diagram to package_aliases.tFather Chrysostomos2010-10-101-0/+9
|
* Make more ways to move packages around reset isa cachesFather Chrysostomos2010-10-091-42/+76
| | | | | | | | This makes string-to-glob assignment and hashref-to-glob assignment reset isa caches by calling mro_package_moved, if the glob’s name ends with ::. Related to [perl #75176].
* Oops. Remove a duplicate require.Father Chrysostomos2010-10-091-1/+1
|
* Reset isa on stash manipulationFather Chrysostomos2010-10-091-1/+76
| | | | | | | | | | | | This only applies to glob-to-glob assignments and deletions of stash elements. Other types of stash manipulation are dealt with by subse- quent patches. It adds mro_package_moved, a private function that iterates through subpackages, calling mro_isa_changed_in on each. This is related to [perl #75176], but is not the same bug. It simply got in the way of fixing [perl #75176].
* Move pod2html.PL into ext/Pod-HtmlNicholas Clark2010-10-051-0/+1
| | | | | Let ExtUtils::MakeMaker deal with running these extraction scripts, rather than repeating the logic in (at least) 5 places.
* Move pod2man.PL, pod2text.PL, podselect.PL into cpan/podlators/scriptsNicholas Clark2010-10-051-0/+3
| | | | | Let ExtUtils::MakeMaker deal with running these extraction scripts, rather than repeating the logic in (at least) 5 places.
* Move pod2usage.PL, podchecker.PL, podselect.PL into cpan/Pod-Parser/scriptsNicholas Clark2010-10-051-4/+15
| | | | | Let ExtUtils::MakeMaker deal with running these extraction scripts, rather than repeating the logic in (at least) 5 places.
* [perl #45133] -0.0 has variable Boolean valueFather Chrysostomos2010-10-041-0/+12
| | | | | This patch makes -0.0 stringify as "0" (while leaving sprintf %g/%f unchanged).
* [perl #20661] Constant strings representing a number can BECOME numbersFather Chrysostomos2010-10-041-1/+15
| | | | | The & | ^ operators now avoid turning on numericness of read-only arguments.
* Correct test names in negate.tFather Chrysostomos2010-10-041-2/+2
|
* [perl #57706] Unary minus on 'numeric' inputs like '-1'Renée Bäcker2010-10-041-2/+2
| | | | | The attached patch adds the conversion if the value of the SV looks_like_number.
* stop map,grep leaking temps [perl #48004]David Mitchell2010-10-041-1/+43
| | | | | | | | | | | | | | | | The former behaviour of map and grep was to never free any temps. Thus for large lists (and even worse, nested maps), the tmps stack could grow very large. For all cases expect list-context map, the fix is easy: just do a FREETMPS at the end of each iteration. The list-context map however, needs to accumulate a list of temporaries over the course of the iterations, and finally return that list to the caller (which is responsible for freeing them). We get round this by, at the end of each iteration, directly manipulating the tmps stack to free everything *except* the values to be returned. To make this efficient, we splice in the returned tmp items at the base of the stack frame, move PL_tmps_floor above them, then do a FREETMPS (so they may appear twice on the temps stack, but initially only get freed once).
* Test for RT#3363: lexical lvalue under recursionGeorge Greer2010-10-031-1/+18
| | | | | Add a test to ensure that S_refto returns a SVt_PVLV if the original is a SVt_PVLV so that the lvalue-ness is preserved.
* Add a refgen+PADTMP testFather Chrysostomos2010-10-031-2/+11
|
* [perl #48332] Debugger corrupts symbol table mungingFather Chrysostomos2010-09-302-2/+19
| | | | | | | | This reverts commit 92adfbd49af0758bcc9a198cf2df2bd78c4176b9, which removed a necessary assignment for the sake of consting. In doing so, it allows subroutine redefinition to work properly again in the debugger.
* re.t: Suppress warningKarl Williamson2010-09-291-0/+1
|
* Add test against re-eval corrupting regexp stateAndrew Rodland2010-09-291-0/+85
|
* Revert "[perl #77928] Glob slot assignment and set-magic"Father Chrysostomos2010-09-291-14/+1
| | | | This reverts commit cffb36981555111f364a511fb5763f65ea748c0e.
* regcomp.c [perl #78058] qr/\18/ loopsKarl Williamson2010-09-281-2/+7
| | | | | | | | This patch restores the behavior of /\18/ to mean /\0018/, which was inadvertently changed by c99e91e919b4bb89bab7829a9026ee01b1fff2a1. This bug happens when t the first digit is [1-9], and the second [89].
* [perl #77928] Glob slot assignment and set-magicFather Chrysostomos2010-09-281-1/+14
| | | | Stop set-magic from being called after ref-to-glob assignment.
* A test to check that regen.pl doesn't need running.Nicholas Clark2010-09-281-0/+23
| | | | | We can't run regen.pl as part of the build, as we'd end up with a circular dependency between the headers and miniperl.
* [perl #75174] Clone dir handlesFather Chrysostomos2010-09-271-0/+131
| | | | | | | On systems that support fchdir, use it to clone dir handles. On other systems, at least for now, don’t give the new thread a copy of the handle. This is not ideal, but better than crashing.
* Make gv.t pass on systems that do not support -T $glob with stdioFather Chrysostomos2010-09-261-3/+10
|
* [perl #73754] Better error message for PerlIO layer implementationsTye McQueen2010-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | please find attached a patch against blead originating from [1] , that improves the "Layer does not match this perl" error message by telling the user which IO layer failed and how. I've tested the patch against a recent bleadperl and even without the modifications to perldiag.t all tests pass. Still, for completeness, I've patched perldiag.t as well. The code is not mine, it was written and posted by Tye McQueen, I've just tested it [2] and ferry the information. I'm aware that this patch is too late for 5.12 , but in the sense of improving Perl in the long run, I hope the change still makes it into a version of Perl. -max [1] http://perlmonks.org/?node_id=829815 [2] Certified Works On My Machine, 2010
* #!perl -C -w diesFather Chrysostomos2010-09-261-1/+14
| | | | | | parse_unicode_opts expects to end on '\0'. So #!perl -C -w causes an ‘Unknown Unicode option letter ' '’ error. The attached patch fixes it.
* [perl #77362] Assigning glob to lvalue causes stringificationFather Chrysostomos2010-09-261-6/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test from t/op/gv.t was added by change 22315/4ce457a6: { # test the assignment of a GLOB to an LVALUE my $e = ''; local $SIG{__DIE__} = sub { $e = $_[0] }; my $v; sub f { $_[0] = 0; $_[0] = "a"; $_[0] = *DATA } f($v); is ($v, '*main::DATA'); my $x = <$v>; is ($x, "perl\n"); } That change was the one that made glob-to-lvalue assignment work to begin with. But this test passes in perl version *prior* to that change. This patch fixes the test and adds tests to make sure what is assigned is actually a glob, and not just a string. It also happens to fix the stringification bug. In doing so, it essen- tially ‘enables’ globs-as-PVLVs. It turns out that many different parts of the perl source don’t fully take this into account, so this patch also fixes the following to work with them (I tried to make these into separate patches, but they are so intertwined it just got too complicated): • GvIO(gv) to make readline and other I/O ops work. • Autovivification of glob slots. • tie *$pvlv • *$pvlv = undef, *$pvlv = $number, *$pvlv = $ref • Duplicating a filehandle accessed through a PVLV glob when the stringified form of the glob cannot be used to access the file handle (!) • Using a PVLV glob as a subroutine reference • Coderef assignment when the glob is no longer in the symbol table • open with a PVLV glob for the filehandle • -t and -T • Unopened file handle warnings
* Fix spellingKarl Williamson2010-09-251-3/+3
|
* [perl #76814] FETCH called twice - yFather Chrysostomos2010-09-241-4/+1
| | | | | This patch stops y from calling get-magic twice. (This has caused double magick since as far back as 5.6.2.)
* [perl #76814] FETCH called twice - m and sFather Chrysostomos2010-09-241-3/+5
| | | | | | This fixes m and s. It modifies pp_regcomp to avoid extra magic. It also corrects a bug in sv_catsv_flags, which would still call mg_get(ssv) even without the SV_GMAGIC flag set.
* [perl #76814] FETCH called twice - !Father Chrysostomos2010-09-241-1/+1
| | | | | | This fixes ! by changing sv_2bool to sv_2bool_flags (with a macro wrapper) and adding SvTRUE_nomg. It also corrects the docs that state incorrectly that SvTRUE does not handle magic.
* [perl #76814] FETCH called twice - string comparison opsFather Chrysostomos2010-09-241-10/+7
| | | | | | This patch changes sv_eq, sv_cmp, sv_cmp_locale and sv_collxfrm to _flags forms, with macros under the old names for sv_eq and sv_collxfrm, but functions for sv_cmp* since pp_sort.c needs them.
* Add a warning to test.pl if quotes are used in one-liners.Nicholas Clark2010-09-245-10/+14
| | | | | | Fix all the tests that were using quotes, and (by implication) working because barewords are treated as strings, and one-liners aren't run under strict.
* Avoid using double quotes in a one-liner runperl.Nicholas Clark2010-09-241-1/+1
| | | | | test.pl uses "" for command line quoting on Win32, VMS and NetWare, '' on *nix. Hence what "works on my machine" on *nix may not work elsewhere.
* [perl #71806] perldb does not setup %dbline with the shebang option -dFather Chrysostomos2010-09-231-1/+14
| | | | | | | | | | | | | | | The first time gv_fetchfile is called for a particular file, it creates the glob and, if debugging is on, creates an AV. If the glob already exists (i.e., in subsequent calls), the AV is not created. The attached patch moves the check for debugging mode and the creation of the AV outside the if-block that checks whether the glob exists. This bug seems to have existed for a very long time and has been intermittent. It seems that many different things can change the order in which #!perl -d and gv_fetchfile occur. Whether compilation options affect it I do not know. I can reproduce it in 5.6.2, 5.8.[123456] (non-threaded) and 5.11.3 (both threaded and non-threaded), but not 5.8.[789] or 5.10.[01] (threaded).
* [perl #70614] Seg. fault with eval/use/UNITCHECK/DESTROY/eval combinationFather Chrysostomos2010-09-221-1/+5
| | | | | | | | | | | | | This case can be reduced to: eval "UNITCHECK{ eval 0 }" (eval 0 triggers the bug more reliably than eval ''.) The inner eval clobbers PL_eval_start, so when the UNITCHECK finishes, the outer eval tries to call the inner eval’s code, which has been freed already. This commit saves PL_eval_start and restores it after UNITCHECK.
* Add /d, /l, /u (infixed) regex modifiersKarl Williamson2010-09-223-6/+42
| | | | | | | | | | | | This patch adds recognition of these modifiers, with appropriate action for d and l. u does nothing useful yet. This allows for the interpolation of a regex into another one without losing the character set semantics that it was compiled with, as for the first time, the semantics is now specified in the stringification as one of these modifiers. To this end, it allocates an unused bit in the structures. The off- sets change so as to not disturb other bits.
* Add lib to @INC in t/base/rs.tFather Chrysostomos2010-09-221-3/+9
| | | | | | | | | | | | | | | | | | | | | t/base/rs.t needs to @INClude the lib directory before requiring PerlIO::scalar, even if the require is in an eval, because it will otherwise pick up a previously-installed copy. Since 87b9e1600 (Eliminate PL_* accessor functions under ithreads), a binary-incompatible change, I’ve been getting these errors: t/base/rs......................................................dyld: lazy symbol binding failed: Symbol not found: _Perl_Istack_sp_ptr Referenced from: /usr/local/lib/perl5/5.13.5/darwin-thread-multi-2level/auto/PerlIO/scalar/scalar.bundle Expected in: dynamic lookup dyld: Symbol not found: _Perl_Istack_sp_ptr Referenced from: /usr/local/lib/perl5/5.13.5/darwin-thread-multi-2level/auto/PerlIO/scalar/scalar.bundle Expected in: dynamic lookup FAILED--no leader found Failed a basic test (base/rs.t) -- cannot continue. make: *** [test] Error 255
* [perl #20444] regex not evaluated in constant ?:Father Chrysostomos2010-09-201-1/+31
| | | | | | | | | | | | $text =~ ( 1 ? /phoo/ : /bear/) used to be constant-folded to $text =~ /phoo/ This patch solves the problem by marking match and subst ops as OPf_SPECIAL during constant folding, so the =~ operator can tell not to take possession of it.
* [perl #19078] wrong match order inside replacementFather Chrysostomos2010-09-201-1/+23
| | | | | | | | | | | | | | | | | | | | | | $ perl -le '$_="CCCGGG"; s!.!@a{print("[$&]"),/./}!g' [C] [C] [C] [C] [C] [C] What’s happening is that the s/// does not reset PL_curpm for each iteration, because it doesn’t usually have to. The RHS’s scoping takes care of it most of the time. This happens with the /e modifier and with @{...}. In this example, though, we have a subscript, not a block. This sub- script is in the same scope as the s/// itself. The assumption that the substitution operator will never have to reset PL_curpm itself appears to be incorrect. This fixes it.
* Add missing bug numbersFather Chrysostomos2010-09-203-3/+3
|
* [perl #77930] cx_stack reallocation during sortFather Chrysostomos2010-09-201-1/+19
| | | | | Reset cx in pp_sort before POPSUB, as the pointer may no longer be valid.
* porting/manifest.t fail gracefully under !gitDavid Mitchell2010-09-201-0/+1
| | | | | | | | This test was producing spurious output to stderr when not under git control (e.g. a release tarball): fatal: Not a git repository (or any parent up to mount parent ) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
* stop do_clean_named_objs() leaving dangling refsDavid Mitchell2010-09-201-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently perl does 3 major scans of the SV arenas, so the action of perl_destroy() is a bit like this: for (all arena SVs) { if (its a ref to an object) undef the ref (and thus probably free the object) } for (all arena SVs) { if (it's a typeglob and at least one of its slots holds an object) { set SVf_BREAK on the gv SvREFCNT_dec(gv) } } return if $PERL_DESTRUCT_LEVEL < 1; PL_in_clean_all = 1 for (all arena SVs) { set SVf_BREAK on the sv SvREFCNT_dec(sv) } The second scan is problematic, in that by randomly zapping GVs, it can leave dangling pointers to freed GVs. This is while perl-level destructors may still be called, meaning perl users can see corrupted state. Note also that at this point PL_in_clean_all hasn't been set, so sv_free() may put out 'Attempt to free unreferenced scalar' warnings. This commit fixes this by only freeing the affected slots of the GV, rather than freeing the GV itself. Thus makes it more like the first pass, which undefs RVs, and ensures no dangling refs.
* Add (?^...) regex constructKarl Williamson2010-09-206-12/+16
| | | | | | | | | | | | | | | | | | This adds (?^...) to signify to use the default regex modifiers for the cluster or embedded pattern-match modifier change. The major purpose of this is to simplify regex stringification, so that "^" is output in place of "-xism". As a result, the stringification will not change in the future when new regex modifiers are added, so tests, etc. that rely on a particular stringification will have to change now, but never again. Code that needs to work properly with both old- and new-style regexes can use something like the following: # Accept both old and new-style stringification my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism'; This construct is Ben Morrow's idea.
* Upgade NEXT from version 0.64 to 0.65Florian Ragwitz2010-09-201-1/+0
| | | | We can now set PERL_CORE again when running its tests.
* Explicitly disable unicode for non-unicode tests in t/op/warn.tTony Cook2010-09-171-2/+2
| | | | These would fail when smokes tested under unicode locales.