| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This fixes a regression introduced with charset regex modifiers. A utf8
pattern without a charset is supposed to mean unicode semantics. But
it didn't until this patch.
|
| |
|
| |
|
|
|
|
|
| |
This reduces the line count by about 25%.
Also, remove the unneeded code to load Config, which is never referenced.
|
|
|
|
|
| |
This will allow it to be used safely for tests that explicitly want to test the
behaviour of perl without (and with) $& having been seen by the parser.
|
|
|
|
|
| |
This is apparently undocumented except in perldiag and a previous
perldelta.
|
|
|
|
|
| |
Only blead-visible change from 1.94_65 are version numbers and
the addition of the 2011 PAUSE batch signing key.
|
| |
|
| |
|
|
|
|
|
| |
test.pl no longer uses closures, which removes the principal reason for
avoiding it until now. anonsub.t is now 25% shorter.
|
|
|
|
|
|
|
|
|
| |
In the general case a closure is the "right" way to do "it". However, closures,
unlike local and regular subroutines, have some complexity at compile time,
which means that using closures in test.pl runs the risk of closure bugs
causing spurious hard to diagnose collateral damage to other tests. local is
already in use, and "has" to work for capturing warnings, as $SIG{__WARN__} is
localised already.
|
|
|
|
|
|
| |
This reduces its line count by 25%, with no loss of functionality.
(It actually tests slightly more, specifically that the regexps in @death don't
generate warnings, just die.)
|
|
|
|
|
| |
Add a passing variant which mentions $&. Note the bug number (#86042) in the
TODO test.
|
| |
|
|
|
|
|
| |
Also move the use of strict and warnings after the BEGIN block, so that they
can take advantage of the @INC setting it performs. Swap to done_testing().
|
|
|
|
|
|
| |
Use ok() rather than the more "obvious" is(), cmp_ok() etc to strictly control
the number of accesses made to the passed in value. For example, is() accesses
its $got more than once, which defeats the purpose of this test.
|
| |
|
| |
|
|
|
|
| |
DynaLoader after 0a0b6c96e6.
|
|
|
|
| |
Also use tempfile(), rather than names derived from the process ID.
|
|
|
|
|
| |
Move most of the logic for "hunt the password data" out of the BEGIN block, as
it has no special reason to be in one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fortunately the effects are mostly benign. There are two boolean conditions -
$where defined, and PerlIO available, making 4 possible combinations. As was,
the code was:
if (not defined $where && $Config{useperlio} eq 'define') {
...
if (-x '/usr/bin/dscl') {
...
if (open (PW, '<', \$data)) {
$where = ...;
would enter the first if block for 3 out of 4 possibilities, skipping only if
*both* $where as defined *and* PerlIO was available. This was not the intent.
However, if PerlIO is unavailable, then the open will fail, $where won't be
set, and the logic continues on below, falling back to /etc/passwd
The intended logic is
if (!defined $where && $Config{useperlio} eq 'define') {
...
ie only enter on 1 of the 4 possibilities - skip unless $where was undefined
and PerlIO was available.
The net effect was that usually the behaviour was the same. The only difference
will be if PerlIO is not available (not the default, and rarely changed),
the password data *is* available from one of the services tested earlier, and
an /usr/bin/dscl executable is present.
In this case, the old code would have reached the open, which would have
failed, but would have closed PW as a side effect. However, because $where
would be defined, the fallback to /etc/passwd would not have been tried.
This would have caused the regression test to fail.
Also, the test C<$Config{useperlio} eq 'define'> is not quite correct, as
$Config{useperlio} will be undef if PerlIO is disabled, and the eq will warn.
|
|
|
|
| |
It is now clearer what the code is doing when, and why.
|
| |
|
|
|
|
|
|
| |
As the test is for 'ne', it passes without the eval. However, the test's
description and surrounding code make it clear that it is a test for the
results of eval.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to obscure closure and goto tricks, it's sometimes possible for the
array or hash in the LHS of 'my @a = ...' and 'my %h = ...' to be
non-empty. At compile-time, these conditions are detected and the assign
op is compiled with the OPpASSIGN_COMMON, making the assignment slower.
This commit speeds it up again by adding a run-time check to pp_aassign
to only do the OPpASSIGN_COMMON code-branch if the LHS isn't an empty
array or hash.
See also #70171.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike test.pl and Test::More, the home-rolled ok() in t/op/inc.t didn't have
a prototype. Hence its arguments are in *list* context, meaning that any match
will return an *empty list* if it fails. Provided ok() was called with a
second, true, parameter, the failed match would not be noticed, because ok()
would register a test pass, because it would now be testing the (intended)
second parameter.
Add a prototype, and fix the logic for the tests affected.
Fortunately this wasn't concealing any bugs.
|
| |
|
|
|
|
|
|
| |
This allows the two (inner) loops that call it to be merged into one.
Swapping the (now merged) inner and outer loops will aid subsequent
refactoring.
|
| |
|
|
|
|
|
| |
perl 5.13.6 to 5.13.10 did not include perldelta entries for
Module::CoreList.
|
| |
|
|
|
|
|
| |
On blead IO::File would be autoloaded but can't rely on this as
Storable is dual life.
|
|
|
|
|
|
| |
Storable isn't that large by today's standards; using AutoLoader
doesn't make much sense now. Although barely significant this shaves
about 1% off the execution time of the tests on my machine.
|
| |
|
|
|
|
|
|
|
| |
/a and /u should match identically case-insensitively, but they didn't.
Nor was /a being tested because it was thought that they handled things
identically, and the tests were already taking too long. So this adds
some tests as well.
|
|
|
|
| |
Replace its alarm_ok() with test.pl's watchdog().
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Whilst the package separator is a double colon, config.sh ends up using a /
for the package separator, reflecting how, historically, extensions were
laid out in nested directories beneath ext/. The layout has changed, but the
convention in the config.sh entries, and hence the %Config::Config values,
remains the same.
Hence skip_all_without_dynamic_extension() needs to convert passed-in ::s to
/ before performing a lookup.
|
|
|
|
|
|
| |
All callers were using it with dynamic extensions, and also had a
skip_all_if_miniperl() for the same extension. Merge the two tests into one
function to save repetition.
|
| |
|
| |
|
|
|
|
|
|
| |
This seems a more logical place for it, on the assumptions that
a: only 1 of the 4 programs tried will produce results
b: Reading from /etc/passwd is intended as a fallback if none produce results.
|
|
|
|
|
| |
Also refactor the clearing of $reason, without changing the behaviour of when
it is cleared (which is slightly less than logical.)
|
|
|
|
|
|
| |
It's actually the default, but as all the C code is conditionally (not)
compiled on the basis of that pre-processor macro, seems that it is the one
that needs to be reported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we are doing a CURLYX/WHILEM loop and the min iterations is
larger than zero we were not saving the buffer state before each
iteration. This mean that partial matches would end up with strange
buffer pointers, with the start *after* the end point.
In more detail WHILEM has four exits, three of which as far as I could
tell would do a regcppush/regcppop in their state transitions, only one,
WHILEM_A_pre which is entered when (n < min) would not. And it is this state
that we repeatedly enter when performing A the min number of times.
When I made the logic similar to the handling of ( n < max ), the bug
went away, and as far as I can tell nothing else broke.
Review by Dave Mitchell required before release.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Original ticket reports:
print "Match: \$1=$1 \$2=$2" if 'ab' =~/^((\w+)(?{print defined $2 ? "\$2=$2\n" : "\$2 not defined\n"})){2}$/;
Produces the following incorrect output:
$2=ab
$2 not defined
$2=b
Match: $1=b $2=b
It should produce:
$2=ab
$2=a
$2=b
Match: $1=b $2=b
This adds a TODO test to verify this behavior.
|
|
|
|
| |
Also, assign directly to variables, instead of going via $1 to $7.
|
|
|
|
|
|
| |
Previously some (not all) of the "y"es cases detailed the expected code point.
Add all those that were missing, and update the parsing regexp to cope with
multiple Unicode characters.
|