This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add tests for regex recompilation
authorDavid Mitchell <davem@iabyn.com>
Mon, 19 Dec 2011 12:27:48 +0000 (12:27 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:32:48 +0000 (13:32 +0100)
commit23af30a1edf3b57b8b6950f73f724cce1266fdbd
tree8509e3888ff6176bea7dc5e133a74e61f53e0397
parent629cd4f36c79e2b9633bff622171e643c504eaf2
add tests for regex recompilation

The run-time regexp compilation (invoked via pp_regcomp()) has a mechanism
to skip the recompilation if the pattern text hasn't changed since the
last recompile. Astonishingly this mechanism isn't actually tested, so
here's a test file.

All the tests now pass, but this is due to the various recent fixes in
this branch. In particular, it never used to consider the UTF8ness of the
pattern string, or whether the pattern contained code blocks.

It works by checking the output of 'use re debug' (and -Dr if available)
to detect how many times the pattern was compiled.

This file then is also an indirect test of whether the correct debugging
output is generated, i.e. whether the regcomp.c or ext/re/re_comp.c
versions of functions are getting called.
MANIFEST
t/re/recompile.t [new file with mode: 0644]