summaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Fix /[\8]/ to not match NULL; give correct warningKarl Williamson2010-09-162-0/+28
| | | | | | | | | | 8 and 9 are not treated as alphas in parsing as opposed to illegal octals. This also adds tests to verify that 1-3 digits work in char classes. I created an isOCTAL macro in case that lookup gets moved to a bit field, as I plan to do later, for speed.
* Fix "Wide character in warn" warningFather Chrysostomos2010-09-161-1/+8
|
* Fix warn to respect utf8-encoded scalars [perl #45549]Father Chrysostomos2010-09-161-1/+25
|
* change warn.t to use test.plFather Chrysostomos2010-09-161-11/+13
|
* Add new_ok() to create and test objects. From Test::More.Michael G. Schwern2010-09-151-0/+27
|
* Add note() to put informational notes into the TAP (from Test::More)Michael G. Schwern2010-09-151-4/+14
|
* Add done_testing from Test::MoreMichael G. Schwern2010-09-151-0/+11
|
* Shut up "used only once" warnings.Michael G. Schwern2010-09-151-2/+6
| | | | Not very elegant, but it avoids using $^W or warnings.pm.
* Upgrade Math::BigRat from version 0.25 to 0.26Florian Ragwitz2010-09-151-2/+0
| | | | | Lots of unnecessary test boilerplate has been removed, allowing us to remove the dist from both %abs and %temp_no_core in t/TEST.
* Extra tests for a regex followed by an operator or a statement modifier.Bram2010-09-131-1/+36
| | | | (For example: m//and print "foo")
* Add tests for 72922.Bram2010-09-131-1/+62
| | | | Check that a Regex object which was previous copied and weaken'ed can be used in another pattern.
* [perl #77684] Restore the 5.10/12 behaviour of open $fh, ">", \$glob_copyFather Chrysostomos2010-09-131-1/+11
| | | | | | | | | This restores the perl 5.10/12 behaviour, making open treat \$foo as a scalar reference if it is a glob copy (SvFAKE). It also fixes an existing assertion failure that the test now trig- gers. PerlIOScalar_pushed was not downgrading the sv before set- ting SvCUR.
* list cxt hash assign with dups gives garbageDavid Mitchell2010-09-111-2/+4
| | | | | | | | | | | | | | | | | | | | | | Fix for #31865: weird results from reverse( %x = reverse %h ) Basically, anything of the form @a = %h = (list with some duplicate keys) may have left @a containing weird and/or freed values. There was a partial fix for this with ca65944e, but it was broken (it did one big block move on the stack at the end to remove duplicates, but duplicates weren't necessarily all in one block.) The new fix is a two-stage process. First, while pulling key/value pairs of the stack and assigning them to the hash, each key/val pair is written back to the stack - possibly at a lower position if there are duplicates to be skipped. Finally at the end if any duplicates have been detected, then in list context, a single pass is made through the stack, and for each key/val pair, the key is looked up and the val on the stack is overwritten with the new value (replacing possibly freed or other garbage values).
* segfault on &Internals::* due to missing SvROK()Ævar Arnfjörð Bjarmason2010-09-111-0/+25
| | | | | | | | | | | | | | | | | | | | Change the &Internals::* functions that use references in their prototypes to check if the argument is SvROK() before calling SvRV(). If the function is called as Internals::FOO() perl does this check for us, but prototypes are bypassed on &Internals::FOO() so we still have to check this manually. This fixes [perl #77776], this bug was present in 5.10.x, 5.12.x, and probably all earlier perl versions that had these functions, but I haven't tested that. I'm adding a new test file (t/lib/universal.t) to test universal.c functions as part of this patch. The testing for Internal::* in t/ was and is very sparse, but before universal.t there was no obvious place to put these tests. Signed-off-by: Ævar Arnfjörð Bjarmason <avar@cpan.org>
* improve registration of warning categoriesRicardo Signes2010-09-101-0/+18
| | | | | | | | | | | | | | | | | | | | 1. &warnings::register is added as the public mechanism for adding new warning categories, rather than warnings::register::import knowing about warnings's internals 2. warnings::register::import is updated to use &warnings::register 3. warnings::register::import can take a list of subcategories The upshot is that you can now write: package MyTool; use warnings::register qw(io typos); warnings::warnif('MyTool::io', $message); ...and tools that register new warnings categories do not need to cargo cult code from warnings/register.pm
* Remove obsolete core test directory boilerplate from Math::BigInt.Nicholas Clark2010-09-101-1/+0
| | | | | | | This was only needed for testing in the core, when the core's tests all ran the top level t/ directory. Without this getting in the way, we don't need t/TEST and t/harness to run the tests with absolute paths in @INC. Testing in the CPAN distribution is unaffected.
* Remove obsolete core test directory boilerplate from bignum.Nicholas Clark2010-09-101-1/+0
| | | | | | | This was only needed for testing in the core, when the core's tests all ran in the top level t/ directory. Without this getting in the way, we don't need t/TEST and t/harness to run the tests with absolute paths in @INC. Testing in the CPAN distribution is unaffected.
* Math-BigInt runs fine under PERL_CORE nowFlorian Ragwitz2010-09-101-1/+0
|
* Teach t/TEST about Math-BigInt in dist/Florian Ragwitz2010-09-091-1/+1
| | | | | This was forgotten in the move from cpan/ to dist/ in commit c510e33d30368bc5440f1651f6b31f73d2354eba.
* bad things happened with for $x (...) { *x = *y }David Mitchell2010-09-081-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | fix for [perl #21469]: since the GP may be pulled from under us and freed, coredumps and strange things can happen. Fix this by storing a pointer to the GV in the loop block, rather than a pointer to the GvSV slot. The ITHREADS variant already stores GV rather than than &GvSV; extend this to non-threaded builds too. Also, for both threaded and non-threaded, it used to push &GvSV on the save stack. Fix this by introducing a new save type, SAVEt_GVSV. This behaves similarly to SAVEt_SV, but without magic get/set. This means that for $package_var (...) is now close in behaviour to local $package_var = ... (except for the magic bit).
* make qw(...) first-class syntaxZefram2010-09-084-4/+249
| | | | | | | | | | This makes a qw(...) list literal a distinct token type for the parser, where previously it was munged into a "(",THING,")" sequence. The change means that qw(...) can't accidentally supply parens to parts of the grammar that want real parens. Due to many bits of code taking advantage of that by "foreach my $x qw(...) {}", this patch also includes a hack to coerce qw(...) to the old-style parenthesised THING, emitting a deprecation warning along the way.
* Move test for #76540 to op/gv.tFlorian Ragwitz2010-09-081-1/+19
| | | | | | | | | Commit e5c69c9b added the test to dist/constant/t/constant.t, probably because the bug was initially reported in combination with constant.pm. However, it was a core bug in gv_init and can be reproduced easily without constant.pm. With this change dist/constant can be safely synced back to CPAN without having to SKIP or TODO this particular test.
* More tests for when(slice)Rafael Garcia-Suarez2010-09-071-1/+39
|
* Fix RT #77468: Smart matching on slicesDavid Leadbeater2010-09-071-1/+25
| | | | | | ref_array_or_hash did not take aslice or hslice OPs into account; wrap them in an anonlist so that smart matching has a reference as it expects.
* $ref++, $ref-- leaked referentDavid Mitchell2010-09-061-1/+17
| | | | | | | | | [perl #9466] pp_postinc and pp_postdec used a pad TARG to return a copy of the original value. When that value was a reference, it meant a copy of the reference would hang out in the pad forever and so the referent would leak. Fix this by using a mortal instead.
* [perl #76138] perl inadvertently destroys signal handlers as of f746176000Father Chrysostomos2010-09-062-1/+143
| | | | | Stop magic applied to $!, %SIG, et al. from applying to similarly- named variables in other packages.
* blead is upstream for bignumFlorian Ragwitz2010-09-031-1/+1
|
* blead is upstream for Math-BigIntFlorian Ragwitz2010-09-021-1/+1
|
* Fix test (see <20100901161607.GB2892@iabyn.com>)Abigail2010-09-021-2/+1
|
* t/lib/common.pl must convert $^X to an absolute path before changing directory.Nicholas Clark2010-09-011-1/+2
| | | | Not every operating system has /proc/self/exe