This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
13 years agoSimplify the regression tests added in 3e6bd4bfcd175c61.
Nicholas Clark [Mon, 28 Feb 2011 10:06:35 +0000 (10:06 +0000)]
Simplify the regression tests added in 3e6bd4bfcd175c61.

Unwind the innermost loop, used only for reporting, and remove the array @s,
only used to accumulate results for that loop. Fewer lines, less complexity,
better diagnostics, and with the same failure cases on 3e6bd4bfcd175c61^.

13 years agoHandle [folds] of 0-255 without swashes
Karl Williamson [Mon, 28 Feb 2011 01:44:43 +0000 (18:44 -0700)]
Handle [folds] of 0-255 without swashes

Commit 56ca34cada940c7f6aae9a59da266e541530041e had the side effect of
causing regular expressions with things like [a-z], or even just [k] to
go out to disk to read tables to create swashes because it knew that
some of those characters matched outside the bitmap (and due to
l1_char_class_tab.h it knew which ones had those matches), but it didn't
know what the characters were that participated in those folds.

This patch hard-codes the Unicode 6.0 rules into regcomp.c for the
code points 0-255, so that the very slow utf8_heavy is not invoked on
them.  (Code points above 255 will continue to invoke it.)  It would,
of course, be better if these rules could be regen'd into regcomp.c, as
there is a risk that the standard will change, and the code will not.
But I don't think that has ever happened; in other words, I think that
the rules haven't changed so far since Day 1 of Unicode.  (That would
not be the case if we were doing simple case folding, as the capital
sharp ss which folds to U+00DF was added later.)  And the Standard is
getting more stable in this area.  I believe one of their stability
policies now forbid them from adding something that simply folds to
one of the characters that already has a fold, such as M and m.
Ligatures are frowned on, and I doubt that new ones would be encoded,
so that leaves a new Unicode character that folds to a Latin-1 plus some
sort of mark.  For those, this code is a no-op, so those aren't a
problem either.

13 years agoregcomp.c: Add deprecation macro with extra param
Karl Williamson [Mon, 28 Feb 2011 01:31:51 +0000 (18:31 -0700)]
regcomp.c: Add deprecation macro with extra param

13 years agoregcomp.c: More prep for bitmap/nonbitmap folds
Karl Williamson [Sun, 27 Feb 2011 22:19:04 +0000 (15:19 -0700)]
regcomp.c: More prep for bitmap/nonbitmap folds

This sets things up in preparation for a future commit that will
move calculating all folds involving characters in the bit map.

13 years agoregcomp.c: Place marker for 2nd inversion list
Karl Williamson [Sun, 27 Feb 2011 21:21:47 +0000 (14:21 -0700)]
regcomp.c: Place marker for 2nd inversion list

The set_regclass_bit functions will be adding to a new inversion list.
This declares that list and passes it to them.

13 years agoChange to use new add_cp_to_invlist()
Karl Williamson [Sun, 27 Feb 2011 21:12:57 +0000 (14:12 -0700)]
Change to use new add_cp_to_invlist()

13 years agoregcomp.c: Add parameters to fcns
Karl Williamson [Sun, 27 Feb 2011 21:04:26 +0000 (14:04 -0700)]
regcomp.c: Add parameters to fcns

A pointer to the list of multi-char folds in an ANYOF node is now passed
to the routines that set the bit map.  This is in preparation for those
routines to add to the list

13 years agoregcomp.c: Convert old-style to inversion list
Karl Williamson [Sun, 27 Feb 2011 20:55:03 +0000 (13:55 -0700)]
regcomp.c: Convert old-style to inversion list

The code that handles a false range in a [character class] hadn't been
converted to use inversion lists

13 years agoregcomp.c: Add fcn add_cp_to_invlist()
Karl Williamson [Mon, 28 Feb 2011 00:51:33 +0000 (17:51 -0700)]
regcomp.c: Add fcn add_cp_to_invlist()

This is just an inline shorthand when a single code point is all that is
needed.  A macro could have been used instead, but this just seemed nicer.

13 years agoregcomp.c: Move code to common place
Karl Williamson [Mon, 28 Feb 2011 00:45:46 +0000 (17:45 -0700)]
regcomp.c: Move code to common place

THis is part of the refactoring of the code that sets the alternate array
for multi-char folds.  Changing the node type to ANYOFV can be done at
the last second, in pass 2, as it doesn't change any sizing, etc.

13 years agoregcomp.c: Factor code into a function.
Karl Williamson [Sun, 27 Feb 2011 20:12:49 +0000 (13:12 -0700)]
regcomp.c: Factor code into a function.

A future commit uses this same code, so put it into a common place.

13 years agoAdd #defines for 2 Latin1 chars
Karl Williamson [Sun, 27 Feb 2011 05:02:26 +0000 (22:02 -0700)]
Add #defines for 2 Latin1 chars

These will be used in a future commit; the ordinals are different on
EBCDIC vs. ASCII

13 years agoMove some #defines
Karl Williamson [Sun, 27 Feb 2011 02:38:29 +0000 (19:38 -0700)]
Move some #defines

These were defined in a .c, but now there is need for them in another .c,
so move them to a header.

13 years agoregcomp.c: Remove no longer necessary tests
Karl Williamson [Sat, 26 Feb 2011 17:21:09 +0000 (10:21 -0700)]
regcomp.c: Remove no longer necessary tests

A previous commit changed add_range_to_invlist() to do the creation
that these lines did.

13 years agoregcomp.c: accept NULL as inversion list param
Karl Williamson [Sat, 26 Feb 2011 17:16:20 +0000 (10:16 -0700)]
regcomp.c: accept NULL as inversion list param

Change the function add_range_to_invlist() to accept NULL as the
inversion list, in which case it creates it.  A common usage of this
function is to create the list if it doesn't exist before calling it, so
this just makes that code once.

13 years agoEliminate tests for tainting of globs, skipped since 1999.
Nicholas Clark [Sun, 27 Feb 2011 11:54:05 +0000 (11:54 +0000)]
Eliminate tests for tainting of globs, skipped since 1999.

Commit 72b166521443a1b8 changed perl to using File::Glob to implement the glob
builtin. Previously glob was implemented by spawning a csh, hence globbing was
not allowed on tainted values. The test for this was skipped, but never removed.

13 years agoIn gv_autoload4(), ensure set magic is called on $...::AUTOLOAD if necessary.
Nicholas Clark [Sun, 27 Feb 2011 21:36:01 +0000 (21:36 +0000)]
In gv_autoload4(), ensure set magic is called on $...::AUTOLOAD if necessary.

Without this, if $...::AUTOLOAD ever becomes tainted, it will never
subsequently become properly untainted. This fixes an omission in change
5d121f7f3e622b95.

13 years agoMaintainers.pl and perldelta updates for Math::BigInt::FastCalc upgrade
Chris 'BinGOs' Williams [Sun, 27 Feb 2011 21:34:43 +0000 (21:34 +0000)]
Maintainers.pl and perldelta updates for Math::BigInt::FastCalc upgrade

13 years agoUpdate Math::BigInt::FastCalc to CPAN version 0.25
Peter John Acklam [Sat, 26 Feb 2011 23:36:42 +0000 (15:36 -0800)]
Update Math::BigInt::FastCalc to CPAN version 0.25

# New Ticket Created by  (Peter J. Acklam)
# Please include the string:  [perl #84982]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=84982 >

Remove _new() from XS code and use _new() in Math::BigInt::Calc
instead. The XS _new() doesn't handle integers that are too large to
be represented exactly as floating point numbers, but small enough
to be represented as 64 bit integers. E.g., even with 64 bit integer
support, applying _num() to 18446744073709551615 (= 2**64-1) gives
1.84467440737096e+19, not 18446744073709551615. The XS _new() also
returns nan, not inf, when it overflows. This closes RT #63335 and
RT #49569.

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
13 years agoAdded GNU/kFreeBSD to list of systems where 5.12.x builds
Chris 'BinGOs' Williams [Sun, 27 Feb 2011 13:31:55 +0000 (13:31 +0000)]
Added GNU/kFreeBSD to list of systems where 5.12.x builds

13 years ago[perl #76814] FETCH called twice - ||
Father Chrysostomos [Sun, 27 Feb 2011 08:50:08 +0000 (00:50 -0800)]
[perl #76814] FETCH called twice - ||

The || case in t/op/tie_fetch_count.t is not a bug, as there are two
separate operators operating on it in the test script. In

  $dummy = $x || $y

The || does mg_get($x). If it’s true it returns it and the = does
mg_get($x). If $x is false, then $y is returned, so magic is called
once on each of $x and $y. Similarly, && will seemingly call
mg_get($x) twice if $x is false.

If you just write:

  $x || $y

then magic is only called once on $x.

This patch corrects the test.

13 years ago[perl #79442] A #line "F" in a string eval doesn't update *{"_<F"}
Father Chrysostomos [Sun, 27 Feb 2011 08:35:26 +0000 (00:35 -0800)]
[perl #79442] A #line "F" in a string eval doesn't update *{"_<F"}

There are two problems here.

String evals do not populate @{"_<..."} arrays the way parsed streams
do. The lines are all put into the array before the parse. Commit
e66cf94 added the code to copy (actually alias, but whatever) the
lines into the new array when a #line directive is encountered. Inte-
restingly, the following commit (8a5ee59) wrapped that code in an
#ifndef USE_ITHREADS block, because ‘[c]hange 25409 [e66cf94] wasn’t
necessary for threaded perls’. It seems it *was* necessary for
threaded perls after all, because the lines are simply not copied.

In non-threaded perls it wasn’t working properly either. The array
in the new glob was the same array as the old (aliased), so the line
numbers would be off if the #line directive contained a line number
that differed.

This commit does three things:
• It removes the #ifndef,
• It checks whether the line number has changed and aliases the indi-
  vidual elements of the array.
• The breakpoints hash is not copied if the line number differs, as
  setting a breakpoint on (eval 1):1 (warn 1) in
    eval qq{warn 1;\n#line 1 "foo"\nwarn 2;}
  should not also set a breakpoint on foo:1 (warn 2).

13 years agoregexec.c: Array declared 1 too small
Karl Williamson [Sat, 26 Feb 2011 23:26:22 +0000 (16:26 -0700)]
regexec.c: Array declared 1 too small

The bounds of this array were being exceeded causing smoke failures on
netbsd

13 years agoModern cygwin often has empty $ENV{CYGWIN}
Reini Urban [Sat, 26 Feb 2011 12:55:41 +0000 (13:55 +0100)]
Modern cygwin often has empty $ENV{CYGWIN}

Fixes Use of uninitialized value $ENV{"CYGWIN"} in concatenation (.) or string
at /usr/lib/perl5/5.13.10/i686-cygwin/Config_heavy.pl line 54

13 years agoStop aelemfast from crashing on GVs with null AVs
Father Chrysostomos [Sat, 26 Feb 2011 06:31:02 +0000 (22:31 -0800)]
Stop aelemfast from crashing on GVs with null AVs

As reported at nntp://nntp.perl.org/1298599236.4753.72.camel@p100 (and
respaced for readability):

#!perl5.12.0
$r=q/
      print __FILE__;
      local *dbline = $main::{"_<".__FILE__};
      print $dbline[0]
/;
eval $r;'
__END__
(eval 1)
Bus error

This only seems to happen in non-threaded perls.

It can be reduced to this:

*d = *a;  print $d[0];

The $d[0] is optimised into an aelemfast op (instead of the usual aelem
with an rv2av kid). pp_aelemfast is at fault, as evidenced by the fact
that this does not crash (the ${\...} prevents the optimisation):

*d = *a;  print $d[${\0}];

pp_aelemfast uses GvAV instead of GvAVn. Usually $d[0] will autovivify
@d, but the glob assignment leaves $d[0] pointing to a glob (*d) with
no array. Then pp_alemfast passes a null pointer around.

13 years agoDon't include commit IDs in generated delta entries
Florian Ragwitz [Sat, 26 Feb 2011 08:05:12 +0000 (09:05 +0100)]
Don't include commit IDs in generated delta entries

We don't usually reference git commits anymore in perldelta, so let's stop
git-deltatool from generating entries like that.

13 years agoHack to allow git-deltatool to spawn 'emacsclient -t'
Florian Ragwitz [Sat, 26 Feb 2011 07:58:16 +0000 (08:58 +0100)]
Hack to allow git-deltatool to spawn 'emacsclient -t'

My $EDITOR is 'emacsclient -t'. system('emacsclient -t', 'more', 'args') won't
do the right thing.

13 years agoAllow reviewing of diffs in the deltatool
Florian Ragwitz [Sat, 26 Feb 2011 07:50:36 +0000 (08:50 +0100)]
Allow reviewing of diffs in the deltatool

The pager code is mostly stolen from Prophet::CLI.

13 years agoReword perltie/READLINE and correct example
Father Chrysostomos [Sat, 26 Feb 2011 05:52:22 +0000 (21:52 -0800)]
Reword perltie/READLINE and correct example

13 years ago[perl #84942] perltie.pod READLINE list context
Kevin Ryde [Sat, 26 Feb 2011 05:50:50 +0000 (21:50 -0800)]
[perl #84942] perltie.pod READLINE list context

In perltie.pod the handle READLINE says

    The method should return undef when there is no more data.

which made me think that's what it should always do, and didn't need to
pay attention to wantarray().

If I'm not mistaken in list context READLINE should return empty list
for no more data.  It'd be good if the docs noted that, and perhaps
cross referenced to perlfunc for the gory details of what readline
should do.

Maybe something like the following, unless someone can think of a better
contrivance for the sample.

13 years agoAdd Kevin Ryde to AUTHORS
Father Chrysostomos [Sat, 26 Feb 2011 05:49:17 +0000 (21:49 -0800)]
Add Kevin Ryde to AUTHORS

13 years ago[perl #84746] Accessing $2 causes the interpreter to crash
Father Chrysostomos [Sat, 26 Feb 2011 04:45:08 +0000 (20:45 -0800)]
[perl #84746] Accessing $2 causes the interpreter to crash

Actually, it doesn’t. The original test case was:

#!/usr/bin/perl

my $rx = qr'\$ (?| {(.+?)} | (.+?); | (.+?)(\s) )'x;
my $test = '/home/$USERNAME ';
die unless $test =~ $rx;
print "1: $1\n";
print "2: $2\n" if defined $2;

This crashes even if I put an ‘exit’ right after the pattern match.

What’s happening is that regcomp miscounts the number of capturing
parenthesis pairs (cf. [perl #59734]), so the execution of the regular
expression causes a buffer overflow which overwrites the op_sibling
field of the regcreset op, causing a crash when the op is freed. (The
exact failure may differ between builds, platforms, etc., of course.)

S_reg in regcomp.c keeps a count of the parenthesised groups in a
(?|...) construct, which it updates after each branch, if that branch
has more captures than any previous branch. But it was not updating
the count after the last branch.

So this bug would occur if the last branch had more capturing paren-
theses than any previous branch.

Commit ee91d26, which fixed bug #59734, only solved the problem when
there was just one branch (by updating the count before the loop that
deals with subsequent branches was entered).

This commit changes the code at the end of S_reg to take into account
that RExC_npar (the current paren count) might have been increased by
the last branch.

Since the loop to deal with subsequent branches resets the count
*before* each branch, the code that commit ee91d26 added is no longer
necessary, so this commit removes it.

13 years agobleadperl breaks RCLAMP/Text-Glob
Karl Williamson [Sat, 26 Feb 2011 03:31:30 +0000 (20:31 -0700)]
bleadperl breaks RCLAMP/Text-Glob

This was from commit f424400810b6af341e96230836690da51c37b812
which came from needing a bit in an already-full flags field,
and my faulty analysis that two bits could be shared.  I found another
mechanism to free up another bit, and now can separate these shared
bits again.

13 years agoFree up bit in ANYOF flags
Karl Williamson [Sat, 26 Feb 2011 03:10:47 +0000 (20:10 -0700)]
Free up bit in ANYOF flags

This is the foundation for fixing the regression RT #82610.  My analysis
was wrong that two bits could be shared, at least not without further
work.  This changes to use a different mechanism to pass needed
information to regexec.c so that another bit can be freed up and, in a
later commit, the two bits can become unshared again.

The bit that is freed up is ANYOF_UTF8, which basically said there is
something that is matched outside the ANYOF bitmap, and requires the
target string to be in utf8.  This changes things so the existence of
something besides the bitmap indicates this, and so no flag is needed.
The flag bit ANYOF_NONBITMAP_NON_UTF8 remains to indicate that there is
something that should be matched outside the bitmap even if the target
string isn't in utf8.

13 years agoregcomp.c: ANYOF node handle range to UV_MAX
Karl Williamson [Sat, 26 Feb 2011 03:02:59 +0000 (20:02 -0700)]
regcomp.c: ANYOF node handle range to UV_MAX

13 years agoregcomp.c: Move inversion list conversion code
Karl Williamson [Fri, 25 Feb 2011 18:52:35 +0000 (11:52 -0700)]
regcomp.c: Move inversion list conversion code

This just moves the code to later in the subroutine, in preparation for future commits

13 years agoregcomp.c: Use more precise ANYOF flag
Karl Williamson [Fri, 25 Feb 2011 18:42:02 +0000 (11:42 -0700)]
regcomp.c: Use more precise ANYOF flag

As the comment above the changed line says, \p doesn't have to match only
utf8, but it sets the flag that is two bits, meaning UTF8.  Set just the
one flag.

13 years agoregcomp.c: Add comment
Karl Williamson [Fri, 25 Feb 2011 17:46:34 +0000 (10:46 -0700)]
regcomp.c: Add comment

13 years agoUpgrade Tie::RefHash from version 1.38 to 1.39
Florian Ragwitz [Fri, 25 Feb 2011 17:30:18 +0000 (18:30 +0100)]
Upgrade Tie::RefHash from version 1.38 to 1.39

13 years agoUpgrade Devel::DProf to version 20110225.01
Florian Ragwitz [Fri, 25 Feb 2011 17:07:18 +0000 (18:07 +0100)]
Upgrade Devel::DProf to version 20110225.01

We needed another upload to fix a PAUSE indexing problem.

13 years agoDProf is now maintained on CPAN, not by p5p anymore
Florian Ragwitz [Fri, 25 Feb 2011 16:28:36 +0000 (17:28 +0100)]
DProf is now maintained on CPAN, not by p5p anymore

13 years agoRemove DProf's Changes file
Florian Ragwitz [Fri, 25 Feb 2011 16:27:54 +0000 (17:27 +0100)]
Remove DProf's Changes file

From now on all changes will go through CPAN first and the Changes file is being
maintained there. No need to keep it around in the core.

13 years agoRemove DProf's Makefile.PL
Florian Ragwitz [Fri, 25 Feb 2011 15:47:01 +0000 (16:47 +0100)]
Remove DProf's Makefile.PL

make_ext.pl can generate it for us.

13 years agoMaintainers.pl and perldelta updates for Math::BigInt update
Chris 'BinGOs' Williams [Fri, 25 Feb 2011 16:43:41 +0000 (16:43 +0000)]
Maintainers.pl and perldelta updates for Math::BigInt update

13 years agoUpdate Math::BigInt to CPAN version 1.993
Peter John Acklam [Thu, 24 Feb 2011 12:52:17 +0000 (04:52 -0800)]
Update Math::BigInt to CPAN version 1.993

# New Ticket Created by  (Peter J. Acklam)
# Please include the string:  [perl #84844]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=84844 >

Change default backend library from Math::BigInt::FastCalc to
Math::BigInt::Calc, which is included in the Math-BigInt distro.
This avoids recursive distribution dependency (RT #65976).

13 years agoEliminate $::PatchId from t/re/*.t.
Nicholas Clark [Fri, 25 Feb 2011 16:35:06 +0000 (16:35 +0000)]
Eliminate $::PatchId from t/re/*.t.

It was only being used in four places across two files, to add perforce
revision numbers to test descriptions. Replace this with the git commit hash
in the tests' descriptions.

13 years agoRemove now-unnecessary C<use File::Spec> from t/op/inccode.t
Nicholas Clark [Fri, 25 Feb 2011 10:49:50 +0000 (10:49 +0000)]
Remove now-unnecessary C<use File::Spec> from t/op/inccode.t

This has been vestigial since 1c25d394345c1b97 converted it to using test.pl's
tempfile().

13 years agoMigrate t/op/{fork,runlevel,tie}.t to use run_multiple_progs().
Nicholas Clark [Thu, 24 Feb 2011 16:46:49 +0000 (16:46 +0000)]
Migrate t/op/{fork,runlevel,tie}.t to use run_multiple_progs().

The addition of "OPTION random" to all fork.t's tests might be overkill, given
that run_multiple_progs() can specify "random" per test, but as the previous
code in fork.t always sorted before comparison, we are no *worse* off than we
were.

13 years agoMigrate the test running logic from t/lib/common.pl to t/test/pl
Nicholas Clark [Thu, 24 Feb 2011 16:04:45 +0000 (16:04 +0000)]
Migrate the test running logic from t/lib/common.pl to t/test/pl

This will make it available to several tests in t/op, which currently duplicate
it.

13 years agoConvert t/lib/common.pl to lexical filehandles and 3-arg open.
Nicholas Clark [Thu, 24 Feb 2011 14:57:14 +0000 (14:57 +0000)]
Convert t/lib/common.pl to lexical filehandles and 3-arg open.

Remove the unused lexical variable %tempfiles. It would be good to lint
everything - I suspect that there are quite a few unused lexicals stowing away
in the core tests.

13 years agoIn t/lib/common.pl, load File::Path on demand.
Nicholas Clark [Thu, 24 Feb 2011 14:43:52 +0000 (14:43 +0000)]
In t/lib/common.pl, load File::Path on demand.

This will facilitate a subsequent refactoring.

13 years agofold_grind.t: Skip some /aa tests.
Karl Williamson [Fri, 25 Feb 2011 02:11:47 +0000 (19:11 -0700)]
fold_grind.t: Skip some /aa tests.

This skips some tests that aren't likely to provide new information,
where both elements being compared are ASCII.

13 years agofold_grind.t: Skip some ASCII-only tests in /l
Karl Williamson [Fri, 25 Feb 2011 02:01:28 +0000 (19:01 -0700)]
fold_grind.t: Skip some ASCII-only tests in /l

This is to cut down somewhat on the number of tests. These are not
likely to add new information to other tests.

13 years agofold_grind.t: Add comment
Karl Williamson [Fri, 25 Feb 2011 01:57:21 +0000 (18:57 -0700)]
fold_grind.t: Add comment

13 years agofold_grind.t: White space only
Karl Williamson [Fri, 25 Feb 2011 01:40:27 +0000 (18:40 -0700)]
fold_grind.t: White space only

A previous commit introduced a block, but didn't increase the indent
within it to avoid confusion.

13 years agofold_grind.t: Run every charset on non-folds
Karl Williamson [Fri, 25 Feb 2011 01:36:06 +0000 (18:36 -0700)]
fold_grind.t: Run every charset on non-folds

13 years agofold_grind: fix comment
Karl Williamson [Thu, 24 Feb 2011 17:46:23 +0000 (10:46 -0700)]
fold_grind: fix comment

13 years agoregcomp.h: Remove obsolete define
Karl Williamson [Thu, 24 Feb 2011 01:47:56 +0000 (18:47 -0700)]
regcomp.h: Remove obsolete define

13 years agointrpvar.h: Add comment about PERLVARI
Karl Williamson [Thu, 24 Feb 2011 01:46:14 +0000 (18:46 -0700)]
intrpvar.h: Add comment about PERLVARI

13 years agoDetect unsafe signals more reliably on BSD/Solaris
Leon Timmermans [Thu, 24 Feb 2011 21:34:40 +0000 (21:34 +0000)]
Detect unsafe signals more reliably on BSD/Solaris

Previous versions of the Posix spec allowed the struct siginfo_t*
parameter passed to the signal handler to be NULL in certain cases. More
recent Posix specifications (SUSv3) have rescinded this: Now this
parameter is required always to be non-NULL. However we use this
parameter to differentiate between safe and unsafe signals, as in the
former it will always be NULL and in the latter case it should have been
non-NULL.

This patch fixes this issue by also relying on the ucontext_t*
parameter.  This should reliably be non-NULL when using unsafe signals
handlers.

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
13 years agoIn t/lib/common.pl, inline print_err_line into its only caller.
Nicholas Clark [Thu, 24 Feb 2011 13:45:33 +0000 (13:45 +0000)]
In t/lib/common.pl, inline print_err_line into its only caller.

13 years agoIn t/lib/common.pl, inline RandomMatch() into its only caller.
Nicholas Clark [Thu, 24 Feb 2011 13:21:48 +0000 (13:21 +0000)]
In t/lib/common.pl, inline RandomMatch() into its only caller.

13 years agospeedup t/porting/authors.t
David Mitchell [Thu, 24 Feb 2011 11:38:00 +0000 (11:38 +0000)]
speedup t/porting/authors.t

This reduces it from 7.5s to 2.5s on my debugging build.
This works by doing a minimal parse on the output of git log
that just grabs the Author: field.

13 years agospeed up t/porting/filenames.t
David Mitchell [Thu, 24 Feb 2011 10:51:51 +0000 (10:51 +0000)]
speed up t/porting/filenames.t

This reduces it from about 5 seconds to <1 second on my debugging
build.

Chiefly by avoiding expensive test functions for every component of
every MANIFEST filename.

13 years agoIn test.pl, change _fresh_perl* to avoid using closures.
Nicholas Clark [Thu, 24 Feb 2011 11:10:25 +0000 (11:10 +0000)]
In test.pl, change _fresh_perl* to avoid using closures.

Whilst closures are definitely a more elegant general solution, the intent of
the initial testing code is to avoid as many "complex" features as possible,
in case they aren't working as intended.

13 years agoFurther consolidate static logical name routines in vms/vms.c
Craig A. Berry [Thu, 24 Feb 2011 01:23:35 +0000 (19:23 -0600)]
Further consolidate static logical name routines in vms/vms.c

sys_trnlnm was a copy-and-paste clone of simple_trnlnm and
sys_crelnm was never used, so nuke them.

13 years agolib/locale.t: big speedup
David Mitchell [Wed, 23 Feb 2011 23:12:04 +0000 (23:12 +0000)]
lib/locale.t: big speedup

This fix reduces the time for this test script on my debugging build
from 45 seconds to 6 seconds.

Basically, the structure of the main loop for test 117 now looks like:

    foreach my $x (keys %UPPER) {
        push @f, $x if (... something bad about $x...)
    }
    foreach my $x (keys %lower) {
        push @f, $x if (... something bad about $x...)
    }
    ok(!@f);

Whereas before it looked like:

    foreach my $x (keys %UPPER) {
        push @f, $x if (... something bad about $x...)
        foreach my $x (keys %lower) {
            push @f, $x if (... something bad about $x...)
        }
    }
    ok(!@f);

i.e. the %lower tests were inadvertently repeated many times

13 years agot/re/fold_grind.t: slight speed up
David Mitchell [Wed, 23 Feb 2011 22:01:04 +0000 (22:01 +0000)]
t/re/fold_grind.t: slight speed up

Hoist a 'next' up a few levels from the innnermost loop, where its
condition is invariant. This shaves a few seconds off the execution time.

13 years agot/re/fold_grind.t: tidy up a bit
David Mitchell [Wed, 23 Feb 2011 17:47:35 +0000 (17:47 +0000)]
t/re/fold_grind.t: tidy up a bit

The previous commit unwrapped an eval; now that the eval's removed,
the code can be tidied up a bit. No functional changes, but it strips
a further few seconds off the execution time.

13 years agomake t/re/fold_grind.t even faster
David Mitchell [Wed, 23 Feb 2011 16:51:40 +0000 (16:51 +0000)]
make  t/re/fold_grind.t even faster

This is currently the slowest test in the suite. On my debugging build,
it takes 3 minutes. This commit reduces it to 1.5 minutes.

This is done by removing the eval in the innermost loop and just
executing the bits it would do directly.

13 years agomake t/re/fold_grind.t faster
David Mitchell [Wed, 23 Feb 2011 12:46:05 +0000 (12:46 +0000)]
make  t/re/fold_grind.t faster

This is currently the slowest test in the suite. On my debugging build,
it takes 4 minutes. This commit reduces it to 3 minutes.

This is done by removing the second layer of eval: The tests are
constructed as strings to be evaled, but were then wrapped in a second
eval to handle TODO etc. This second eval turned out to be unnecessary.

13 years agoMove the tests that blow away %ENV to the end of t/op/magic.t
Nicholas Clark [Wed, 23 Feb 2011 15:56:35 +0000 (15:56 +0000)]
Move the tests that blow away %ENV to the end of t/op/magic.t

If %ENV is cleared, some platforms can't spawn new processes, which prevents
the use of fresh_perl_*().

13 years agoNo need to sort {non_,}bincompat_options in Config, as they are always sorted.
Nicholas Clark [Wed, 23 Feb 2011 11:37:03 +0000 (11:37 +0000)]
No need to sort {non_,}bincompat_options in Config, as they are always sorted.

t/porting/bincompat.t tests that they are in order, so no need to sort them.

13 years agoTest that perl.c reports {non_,}bincompat_options in sorted order.
Nicholas Clark [Wed, 23 Feb 2011 11:06:46 +0000 (11:06 +0000)]
Test that perl.c reports {non_,}bincompat_options in sorted order.

Whilst the actual order doesn't matter semantically, ensuring that they are
always in a sorted order means that string comparison can be used to validate
that two sets of options are identical. This will be useful in the near future
for improved load-time extension compatibility checking.

13 years agoUpdate Test-Simple to CPAN version 0.98
Chris 'BinGOs' Williams [Wed, 23 Feb 2011 10:20:34 +0000 (10:20 +0000)]
Update Test-Simple to CPAN version 0.98

  [DELTA]

  0.98  Wed, 23 Feb 2011 14:38:02 +1100
    Bug Fixes
    * subtest() should not fail if $? is non-zero. (Aaron Crane)

    Docs
    * The behavior of is() and undef has been documented. (Pedro Melo)

13 years agoSkip t/re/pat_{advanced,rt_report}.t under minitest, as they use %- and %+
Nicholas Clark [Wed, 23 Feb 2011 09:35:04 +0000 (09:35 +0000)]
Skip t/re/pat_{advanced,rt_report}.t under minitest, as they use %- and %+

miniperl can't load Tie::Hash::NamedCapture, and as minitest is run if you
have build problems sufficiently severe that you can't bootstrap, it seems
unlikely that the advanced and obscure functionality of the regexp engine is
your most important concern. Hence better to skip it, than to try to bend it
to "portability".

13 years agoSkip the test for #77684 under minitest, as it requires PerlIO::scalar
Nicholas Clark [Tue, 22 Feb 2011 15:52:27 +0000 (15:52 +0000)]
Skip the test for #77684 under minitest, as it requires PerlIO::scalar

13 years agoperlfunc: typos, grammar, rewording
Father Chrysostomos [Wed, 23 Feb 2011 06:32:47 +0000 (22:32 -0800)]
perlfunc: typos, grammar, rewording

13 years agofoldEQ_utf8(): Move rare tests out of main stream
Karl Williamson [Wed, 23 Feb 2011 03:19:21 +0000 (20:19 -0700)]
foldEQ_utf8(): Move rare tests out of main stream

The code for handling locale can be moved entirely to the place where
locale handling is done for the second string, as by that time we have
processed the first string, and the second.  Since we only succeed
if both are atomic, single-bytes, we don't need to do the loop below.

13 years agoRemove unused static function popen_translate from vms.c.
Craig A. Berry [Wed, 23 Feb 2011 03:36:04 +0000 (21:36 -0600)]
Remove unused static function popen_translate from vms.c.

13 years agoperlfunc/goto: Note the llafr exemption
Father Chrysostomos [Wed, 23 Feb 2011 02:09:36 +0000 (18:09 -0800)]
perlfunc/goto: Note the llafr exemption

13 years agoYet more perlfunc tweaks
Father Chrysostomos [Wed, 23 Feb 2011 02:08:08 +0000 (18:08 -0800)]
Yet more perlfunc tweaks

13 years agoperlfunc/formline: Suggest an alternate capturing method
Father Chrysostomos [Tue, 22 Feb 2011 21:01:49 +0000 (13:01 -0800)]
perlfunc/formline: Suggest an alternate capturing method

(When I was starting to program in Perl, I wasted a lot of time trying
to use formline as an alternate version of write, in order to capture
the output. Eventually I created a pipe() and used that. But now we
have scalar ‘filehandles’, it’s much easier.)

13 years agoperlfunc/fileno: Document the -1 retval
Father Chrysostomos [Tue, 22 Feb 2011 20:57:00 +0000 (12:57 -0800)]
perlfunc/fileno: Document the -1 retval

13 years agoYet another set of perlfunc tweaks
Father Chrysostomos [Tue, 22 Feb 2011 20:53:05 +0000 (12:53 -0800)]
Yet another set of perlfunc tweaks

13 years agocharset.t: Skip locale tests if non locale
Karl Williamson [Tue, 22 Feb 2011 20:57:21 +0000 (13:57 -0700)]
charset.t: Skip locale tests if non locale

13 years agofold_grind.t: Skip locale tests if wrong locale
Karl Williamson [Tue, 22 Feb 2011 20:56:33 +0000 (13:56 -0700)]
fold_grind.t: Skip locale tests if wrong locale

13 years agofold_grind.t: Don't use test numbers for todos
Karl Williamson [Tue, 22 Feb 2011 20:54:31 +0000 (13:54 -0700)]
fold_grind.t: Don't use test numbers for todos

This converts the todos into ones derived by looking at what is failing.
It is so what is actually tested by the test suite can vary.

13 years agot/test.pl: Add is_miniperl()
Karl Williamson [Tue, 22 Feb 2011 18:18:58 +0000 (11:18 -0700)]
t/test.pl: Add is_miniperl()

So that .t's which can't easily know how many to skip can access
the functionality.

13 years agoAllow t/re/regexp.t to conditionally skip tests on miniperl
Nicholas Clark [Tue, 22 Feb 2011 21:06:17 +0000 (21:06 +0000)]
Allow t/re/regexp.t to conditionally skip tests on miniperl

Annotate that all tests for %+ and %- are to be skipped on miniperl.

13 years agoSkip a warnings test under miniperl that relies on the effects of -C
Nicholas Clark [Tue, 22 Feb 2011 20:04:17 +0000 (20:04 +0000)]
Skip a warnings test under miniperl that relies on the effects of -C

miniperl ignores -C and $ENV{PERL_UNICODE}, as of e27b5b51275a893e.

13 years agomake /\p{isUserDefined}/ die on taint
David Mitchell [Tue, 22 Feb 2011 16:28:20 +0000 (16:28 +0000)]
make /\p{isUserDefined}/ die on taint

If the string which contains the name of a user-defined character property
function is tainted, then die rather than calling that function.
See [perl #82616].

13 years agoAvoid loading modules for %! and %+ on meeting %{"foo::!"} and %{"foo::+"}
Nicholas Clark [Tue, 22 Feb 2011 15:19:34 +0000 (15:19 +0000)]
Avoid loading modules for %! and %+ on meeting  %{"foo::!"} and %{"foo::+"}

Previously, just %{"foo::!"} would not trigger a load of Errno, but
${"foo::!"}; %{"foo::!"}; would, due to the different code paths taken through
Perl_gv_fetchpvn_flags(). As the modules themselves are responsible for calling
tie on the relevant global variables, there never was a problem with the wrong
variables *getting* their behaviour. However, the attempted load of the XS
module Tie::Hash::NamedCapture for %{"foo::-} meant that t/op/leaky-magic.t
would not pass under minitest. This commit resolves that failure.

13 years agogenmake mention from perlembed.pod is bogus
Vadim Konovalov [Tue, 22 Feb 2011 06:01:26 +0000 (22:01 -0800)]
genmake mention from perlembed.pod is bogus

it appears that chunk of explanations in perlembed.pod is repeating
some facts that already present in README.win32, yet they are now
old and mostly questionable: no special care should be taken on Win32
nowadays.

13 years agoRevert "Revert "fold_grind.t: Test multi-char folds""
Karl Williamson [Tue, 22 Feb 2011 04:42:47 +0000 (21:42 -0700)]
Revert "Revert "fold_grind.t: Test multi-char folds""

This reverts commit 7d8bc0b3c2c9f56519ce821ceccee5113f7e4bb9
to reinstate multi-char fold tests.

13 years agointrpvar.h: Need to initialize PL_utf8_foldable
Karl Williamson [Tue, 22 Feb 2011 04:26:42 +0000 (21:26 -0700)]
intrpvar.h: Need to initialize PL_utf8_foldable

13 years agoRemove various indirect method calls in IO's docs
Boris Ratner [Mon, 21 Feb 2011 12:39:40 +0000 (14:39 +0200)]
Remove various indirect method calls in IO's docs

Also do the same in some of its error messages. This fixes CPAN RT#65836.

13 years agoUpdate Test-Harness to CPAN version 3.23
Chris 'BinGOs' Williams [Mon, 21 Feb 2011 23:20:14 +0000 (23:20 +0000)]
Update Test-Harness to CPAN version 3.23

  [DELTA]

  3.23    2011-02-20
        - Merge in changes from core. Thanks BinGOs.
        - Made SourceHandler understand that an executable binary file
          is probably an executable.
        - Added workaround for Getopt::Long 2.25 handling of
          multivalue options. Fixes test failure on stock perl 5.6.2.

13 years agoUpdate JSON-PP to CPAN version 2.27104
Chris 'BinGOs' Williams [Mon, 21 Feb 2011 22:48:18 +0000 (22:48 +0000)]
Update JSON-PP to CPAN version 2.27104

  [DELTA]

  2.27104  Thu Jan 20 19:06:25 2011
    - fixed a problem to convert overloaded objects (pointed by rt#64783)
    - changed decoding methods object() and array() to pass a object.

13 years agoTwo functions shouldnt be declared inline
Karl Williamson [Mon, 21 Feb 2011 17:17:17 +0000 (10:17 -0700)]
Two functions shouldnt be declared inline