• 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.

Item3667: Unit test bed is too sensitive to the exact syntax of HTML tags (which depends on CGI version)

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine UnitTests Enhancement Closed   patch  

Edit Form Data

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

Detail

Unit test cases that test for larger HTML tags fails depending on the sequence of parameters and use of quotation marks

The CGI CPAN lib which is part of standard Perl has changed the sequence over the years. This is not an error. The sequence has no importance in the function of the tags. But the difference is reported as errors running current unit tests on for example Perl 5.6.1.

Another difference is the use of quotation marks round numbers. These are recommended in newer standards of HTML but it is not an error to ommit them.

I have carefully inspected all the 10 failures we have in two unit test cases and found the actual result to be OK. So it will not uphold a release of 4.1.2. But it is best that the unit tests run cleanly so that no new hidden defects sneaks in and are overlooked as being the usual noise.

This is the result of a full TWikiSuite unit test case run on Perl 5.6.1 after all other unit test issues have been resolved.

perl ../bin/TestRunner.pl TWikiSuite.pm
exporting TWIKI_ASSERTS=1 for extra checking; disable by exporting TWIKI_ASSERTS=0
Assert checking on 1
....................................DEBUG: dir=/var/www/Patch04x01/pub/TemporaryStoreAutoAttachTestWeb/UnitTest1
.Subroutine ASSERT redefined at /var/www/twiki/lib/TWiki/If.pm line 21
Prototype mismatch: sub TWiki::ASSERT vs ($;$) at /var/www/twiki/lib/TWiki/If.pm line 21
Subroutine UNTAINTED redefined at /var/www/twiki/lib/TWiki/If.pm line 21
Prototype mismatch: sub TWiki::UNTAINTED vs ($) at /var/www/twiki/lib/TWiki/If.pm line 21
Subroutine affirm redefined at /var/www/twiki/lib/TWiki/If.pm line 21
Constant subroutine DEBUG redefined at /var/www/twiki/lib/TWiki/If.pm line 21
...............................................................................................F.F.F..F.F.F.F.F.F...................Apache::Htpasswd::htDelete - User notauser not found in /tmp/junkpasswd:  at /var/www/twiki/lib/TWiki/Users/ApacheHtpasswdUser.pm line 79
[Wed Feb 21 10:20:29 2007] TestRunner.pl: Apache::Htpasswd::htDelete - User notauser not found in /tmp/junkpasswd:  at /var/www/twiki/lib/TWiki/Users/ApacheHtpasswdUser.pm line 79
........................................................................................................................test '1' '-eq' '2' failed: Bad file descriptor.sh '-c' 'echo urmf; exit 7' failed: Bad file descriptor.............................................F................................
Time: 165 wallclock secs (24.69 usr 72.46 sys +  1.10 cusr 64.36 csys = 162.61 CPU)

!!!FAILURES!!!
Test Results:
Run: 358, Failures: 10, Errors: 0

There were 10 failures:
1) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form_existingform_params(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:294
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic2" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic2</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic2" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic2</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">Simple description of problem</textarea>

2) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_form(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:209
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestForm</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea>

3) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form_new(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:243
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="_An issue_" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
---+ Example problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="%SCRIPTURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/bin" target="_top">http://192.168.1.101/twiki/bin</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="%SCRIPTURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%SCRIPTURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/bin" target="_top">http://192.168.1.101/twiki/bin</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%SCRIPTURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
---+ Example problem</textarea>

4) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form_params(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:277
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="_An issue_" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
---+ Example problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="%SCRIPTURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/bin" target="_top">http://192.168.1.101/twiki/bin</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="%SCRIPTURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%SCRIPTURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/bin" target="_top">http://192.168.1.101/twiki/bin</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%SCRIPTURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
---+ Example problem</textarea>

5) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:226
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestForm</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea>

6) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form_new_params(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:310
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1XXXXXXXXXX" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1XXXXXXXXXX</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1XXXXXXXXXX" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1XXXXXXXXXX</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea>

7) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form_existingform(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:260
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="_An issue_" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
---+ Example problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="%SCRIPTURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/bin" target="_top">http://192.168.1.101/twiki/bin</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="%SCRIPTURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%SCRIPTURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/bin" target="_top">http://192.168.1.101/twiki/bin</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%SCRIPTURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
---+ Example problem</textarea>

8) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_dont_expand_on_edit(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:348
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="%SCRIPTURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/bin" target="_top">http://192.168.1.101/twiki/bin</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="$percntSCRIPTURL%" /><div class="twikiEditFormLabelField">$percntSCRIPTURL%</div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea>

9) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form_notext_params(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:327
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/WebHome" target="_top">http://192.168.1.101/twiki/pub/TestWeb/WebHome</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/WebHome" target="_top">http://192.168.1.101/twiki/pub/TestWeb/WebHome</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea>

10) /var/www/Patch04x01/test/unit/TOCTests.pm:132 - test_parameters(TOCTests)
expected '?param2=no%20luck;param1=a%20little%20luck', got '?param1=a%20little%20luck;param2=no%20luck'

Test was not successful.

The thing to look for is for example failure 1. The two strings that do not match...

<textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">Simple description of problem</textarea>
<textarea name="IssueDescription"  rows="5" cols="55" class="twikiInputField twikiEditFormTextAreaField">Simple description of problem</textarea>

Note that there are two differences. The missing quotation marks on rows and columns. This is valid but not recommended syntax.

I then tried to "fix" the test cases just for 5.6.1 to see a clean run but then a new error comes up. I only show one of 8 that are all the same.

1) /var/www/Patch04x01/test/unit/TWikiTestCase.pm:160 - test_tmpl_form(InitFormTests)
/var/www/Patch04x01/test/unit/InitFormTests.pm:228
<div class="twikiForm twikiEditForm"><table class="twikiFormTable"><tr><th class="twikiFormTableHRow" colspan="2"><a title="Click to see details in separate window" href="/twiki/bin/view/TestWeb/InitTestForm" target="InitTestForm" rel="nofollow" onclick="return launchWindow(&quot;TestWeb&quot;,&quot;InitTestForm&quot;)">TestWeb.InitTestForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th></tr>
<tr><th align="right"><span title="Illustrative name of issue">Issue Name</span><span class="twikiAlert"> *</span></th><td align="left"><input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Short description of issue">Issue Description</span></th><td align="left"><textarea name="IssueDescription" rows=5 cols=55 class="twikiInputField twikiEditFormTextAreaField">
Simple description of problem</textarea></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">Issue Type</span></th><td align="left"><select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History1</span></th><td align="left"><input type="hidden" name="History1" value="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestForm</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History2</span></th><td align="left"><input type="text" name="History2" value="http://192.168.1.101/twiki/pub/TestWeb/InitTestForm" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History3</span></th><td align="left"><input type="hidden" name="History3" value="%ATTACHURL%" /><div class="twikiEditFormLabelField"><a href="http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1" target="_top">http://192.168.1.101/twiki/pub/TestWeb/InitTestTopic1</a></div></td></tr>
<tr><th align="right"><span title="Click to see details in separate window">History4</span></th><td align="left"><input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField twikiEditFormTextField" /></td></tr> </table> <span class="twikiAlert">*</span> indicates mandatory fields  </div>
does not match
<select name="IssueType" class="twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>

Again let is look at the actual difference.

<select class="twikiEditFormSelect" size="1" name="IssueType"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>
<select name="IssueType" class="twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>

This time it is the sequence of the options that are swapped. This is not even old syntax. This is fully valid syntax but out HTML compare function is not designed to cope with swapping tag options around in sequence.

The last example was the original failure 10.

10) /var/www/Patch04x01/test/unit/TOCTests.pm:132 - test_parameters(TOCTests)
expected '?param2=no%20luck;param1=a%20little%20luck', got '?param1=a%20little%20luck;param2=no%20luck'

Here it is CGI that simply swaps param1 and param2. We have no control of this. It is decided by CGI. And both are fully valid syntax.

For the HTML sequence I think we should fix the test bed to cope with it.

For the missing quotes we may want to make a conditional checker that checks for the version of the CPAN module that creates these. Probably CGI.

And for the swapped URL params maybe here we need again a ted bed update that can check each parameter and not care about sequence.

The good news is that these errors are the remaining errors reported running a Perl 5.6.1 TWikiSuite unit test run and they are not real errors which means we now have all the core unit tests showing no code errors running with Perl 5.6.1. This is simply a matter of getting rid of noise which is why I do not mark this as urgent.

-- TWiki:Main/KennethLavrsen - 21 Feb 2007

Actually this is more the fault of the unit tests, and not the framework. The framework includes two test functions, assert-html_equals and assert_html_includes. The first checks that two entire blocks of HTML are equal. the second checks that a block of HTML contains a subset.

The first function is implemented using HTML::Parser, which parses the HTML and reduces it to a canonical form for comparison. This eliminates the sort of differences such as order of parameters, quotes etc.

The second function predates the first, and compares HTML using regular expression matches. These are quite buggy and unreliable.

The solution is to re-implement assert_html_matches to use the HTML parser, and make the comparison tolerant of non-matching leading and trailing HTML in the content. This has been on the radar for some considerable time now. frown

CC

Not a bug; this is an enhancement. The unit tests work, though they are a bit of a PITA to maintain, i agree.

CC

This should be fixed now (see also Item3367)

CC

ItemTemplate
Summary Unit test bed is too sensitive to the exact syntax of HTML tags (which depends on CGI version)
ReportedBy TWiki:Main.KennethLavrsen
Codebase ~twiki4
SVN Range TWiki-4.1.1, Tue, 20 Feb 2007, build 12932
AppliesTo Engine
Component UnitTests
Priority Enhancement
CurrentState Closed
WaitingFor

Checkins TWikirev:14497
TargetRelease patch
ReleasedIn

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2007-08-03 - TWikiUserMapping_CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback