• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7522: Unit tests: !ConfigureTests::test_parseSave fails under Perl 5.18

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension UnitTests Low No Action Required   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

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

ItemTemplate
Summary Unit tests: !ConfigureTests::test_parseSave fails under Perl 5.18
ReportedBy TWiki:Main.HaraldJoerg
Codebase ~twiki4
SVN Range TWiki-6.0.1-trunk, Sun, 15 Jun 2014, build 27651
AppliesTo Extension
Component UnitTests
Priority Low
CurrentState No Action Required
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r2 - 2014-07-18 - HaraldJoerg
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback