With Perl 5.16 and 5.18, running
!ConfigureTests
fails with the following message:
Expected:'$TWiki::cfg{OptionalRegex} = qr/(?^:^X*$)/;'
But got:'$TWiki::cfg{OptionalRegex} = '^X*$';'
This is related to the fix for
Item7067 /
TWiki:Support.SID-01595
which sorta "works" up to Perl 5.14 in the tests.
But apparently the same kludge to "override" the expected value is also required in Perl 5.16 and 5.18. Was 5.14 so special? Unfortunately I have no machine with 5.14 at hand.
I
guess the version check could be omitted (works for 5.18, and allegedly for versions less than 5.14):
Index: ../../../UnitTestContrib/test/unit/ConfigureTests.pm
===================================================================
--- ../../../UnitTestContrib/test/unit/ConfigureTests.pm (revision 27670)
+++ ../../../UnitTestContrib/test/unit/ConfigureTests.pm (working copy)
@@ -71,7 +71,7 @@
$cfg{Types}{Chosen} = 'TWiki::Configure::Types::STRING';
$cfg{OptionalRegex} = qr/^X*$/;
- my $aRegex = "qr/$cfg{OptionalRegex}/";
- $aRegex = '\'^X*$\'' if( $^V lt v5.14.0 );
+ my $aRegex = '\'^X*$\'';
$cfg{DontIgnore} = 'now is';
$saver->{content} = '';
$out = $saver->_save();
I am not too happy with the implementation of
REGEX
values in configure (the code has a
SMELL
attached to it), because of the conversion between string values and Perl variables and back. The quirks in the test case confirm these doubts. Just recently we fell over a similar design problem with
OCTAL
. But sanitizing configure is not a task for today.
--
TWiki:Main/HaraldJoerg
- 2014-06-22
Ooops... I forgot that I wrote a separate Bug item when committing to
Item7535. So I am closing this one as a duplicate. Sorry for the noise.
--
TWiki:Main.HaraldJoerg
- 2014-07-18