https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ADiff%2Ftestcases Module:Diff/testcases - Revision history 2025-05-30T05:18:45Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.3 https://en.wikipedia.org/w/index.php?title=Module:Diff/testcases&diff=1220572338&oldid=prev W.andrea: Found the problem. Space adjacent to a tag gets escaped. 2024-04-24T16:57:38Z <p>Found the problem. Space adjacent to a tag gets escaped.</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:57, 24 April 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 7:</td> <td colspan="2" class="diff-lineno">Line 7:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_one_change()</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_one_change()</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|one change|a change}}', '&lt;table class="diff" style="width:100%"&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;del class="diffchange diffchange-inline" style="background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;one&lt;/del&gt;<del style="font-weight: bold; text-decoration: none;"> </del>change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;ins class="diffchange diffchange-inline" style="background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;a&lt;/ins&gt;<del style="font-weight: bold; text-decoration: none;"> </del>change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;'<del style="font-weight: bold; text-decoration: none;">, {nowiki=1}</del>)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|one change|a change}}', '&lt;table class="diff" style="width:100%"&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;del class="diffchange diffchange-inline" style="background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;one&lt;/del&gt;<ins style="font-weight: bold; text-decoration: none;">&amp;#32;</ins>change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;ins class="diffchange diffchange-inline" style="background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;a&lt;/ins&gt;<ins style="font-weight: bold; text-decoration: none;">&amp;#32;</ins>change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> </table> W.andrea https://en.wikipedia.org/w/index.php?title=Module:Diff/testcases&diff=1220572164&oldid=prev W.andrea: Add {{nowiki}} to pin down why second test case is failing. 2024-04-24T16:56:22Z <p>Add {{nowiki}} to pin down why second test case is failing.</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:56, 24 April 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 7:</td> <td colspan="2" class="diff-lineno">Line 7:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_one_change()</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_one_change()</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|one change|a change}}', '&lt;table class="diff" style="width:100%"&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;del class="diffchange diffchange-inline" style="background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;one&lt;/del&gt; change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;ins class="diffchange diffchange-inline" style="background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;a&lt;/ins&gt; change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|one change|a change}}', '&lt;table class="diff" style="width:100%"&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;del class="diffchange diffchange-inline" style="background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;one&lt;/del&gt; change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;ins class="diffchange diffchange-inline" style="background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;a&lt;/ins&gt; change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;'<ins style="font-weight: bold; text-decoration: none;">, {nowiki=1}</ins>)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> </table> W.andrea https://en.wikipedia.org/w/index.php?title=Module:Diff/testcases&diff=1220568463&oldid=prev W.andrea: I guess I'm supposed to fill in the module name 2024-04-24T16:29:37Z <p>I guess I&#039;m supposed to fill in the module name</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:29, 24 April 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 1:</td> <td colspan="2" class="diff-lineno">Line 1:</td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>-- Unit tests for [[Module:<del style="font-weight: bold; text-decoration: none;">{{ROOTPAGENAME}}</del>]]. Click talk page to run tests.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>-- Unit tests for [[Module:<ins style="font-weight: bold; text-decoration: none;">Diff</ins>]]. Click talk page to run tests.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local p = require('Module:UnitTests')</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local p = require('Module:UnitTests')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> </table> W.andrea https://en.wikipedia.org/w/index.php?title=Module:Diff/testcases&diff=1220565917&oldid=prev W.andrea: tbody unsupported, but automatically generated. 2024-04-24T16:12:34Z <p><a href="/wiki/Help:HTML_in_wikitext#thead,_tfoot,_tbody" title="Help:HTML in wikitext">tbody unsupported, but automatically generated</a>.</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:12, 24 April 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 3:</td> <td colspan="2" class="diff-lineno">Line 3:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_no_change()</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_no_change()</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|no change|no change}}', '&lt;table class="diff" style="width:100%"<del style="font-weight: bold; text-decoration: none;">&gt;&lt;tbody</del>&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;no change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;no change&lt;/div&gt;&lt;/td&gt;&lt;/tr<del style="font-weight: bold; text-decoration: none;">&gt;&lt;/tbody</del>&gt;&lt;/table&gt;')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|no change|no change}}', '&lt;table class="diff" style="width:100%"&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;no change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;no change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_one_change()</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>function p:test_one_change()</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|one change|a change}}', '&lt;table class="diff" style="width:100%"<del style="font-weight: bold; text-decoration: none;">&gt;&lt;tbody</del>&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;del class="diffchange diffchange-inline" style="background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;one&lt;/del&gt; change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;ins class="diffchange diffchange-inline" style="background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;a&lt;/ins&gt; change&lt;/div&gt;&lt;/td&gt;&lt;/tr<del style="font-weight: bold; text-decoration: none;">&gt;&lt;/tbody</del>&gt;&lt;/table&gt;')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> self:preprocess_equals('{{#invoke:Diff|main|one change|a change}}', '&lt;table class="diff" style="width:100%"&gt;&lt;tr&gt;&lt;td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;−&lt;/td&gt;&lt;td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;del class="diffchange diffchange-inline" style="background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;one&lt;/del&gt; change&lt;/div&gt;&lt;/td&gt;&lt;td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;"&gt;+&lt;/td&gt;&lt;td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"&gt;&lt;div style="word-wrap: break-word; direction: ltr;"&gt;&lt;ins class="diffchange diffchange-inline" style="background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;"&gt;a&lt;/ins&gt; change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> </table> W.andrea https://en.wikipedia.org/w/index.php?title=Module:Diff/testcases&diff=1220563874&oldid=prev W.andrea: Add basic tests in preparation for a more complicated one. 2024-04-24T15:58:20Z <p>Add basic tests in preparation for a more complicated one.</p> <p><b>New page</b></p><div>-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.<br /> local p = require(&#039;Module:UnitTests&#039;)<br /> <br /> function p:test_no_change()<br /> self:preprocess_equals(&#039;{{#invoke:Diff|main|no change|no change}}&#039;, &#039;&lt;table class=&quot;diff&quot; style=&quot;width:100%&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; style=&quot;width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;&quot;&gt;−&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot; style=&quot;border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;&quot;&gt;&lt;div style=&quot;word-wrap: break-word; direction: ltr;&quot;&gt;no change&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot; style=&quot;border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;&quot;&gt;&lt;div style=&quot;word-wrap: break-word; direction: ltr;&quot;&gt;no change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&#039;)<br /> end<br /> <br /> function p:test_one_change()<br /> self:preprocess_equals(&#039;{{#invoke:Diff|main|one change|a change}}&#039;, &#039;&lt;table class=&quot;diff&quot; style=&quot;width:100%&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; style=&quot;width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;&quot;&gt;−&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot; style=&quot;border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;&quot;&gt;&lt;div style=&quot;word-wrap: break-word; direction: ltr;&quot;&gt;&lt;del class=&quot;diffchange diffchange-inline&quot; style=&quot;background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;&quot;&gt;one&lt;/del&gt; change&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot; style=&quot;border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;&quot;&gt;&lt;div style=&quot;word-wrap: break-word; direction: ltr;&quot;&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot; style=&quot;background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;&quot;&gt;a&lt;/ins&gt; change&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&#039;)<br /> end<br /> <br /> return p</div> W.andrea