https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3AJSONutil%2Ftest Modul:JSONutil/test - Versionsgeschichte 2025-04-26T03:03:03Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.44.0-wmf.25 https://de.wikipedia.org/w/index.php?title=Modul:JSONutil/test&diff=190640071&oldid=prev PerfektesChaos: 2019-07-17 2019-07-22T09:48:06Z <p>2019-07-17</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="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 22. Juli 2019, 11:48 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 1:</td> <td colspan="2" class="diff-lineno">Zeile 1:</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 Export = { suite = "JSONutil",</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 Export = { suite = "JSONutil",</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> sub = "test",</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> sub = "test",</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> serial = "2019-<del style="font-weight: bold; text-decoration: none;">05</del>-<del style="font-weight: bold; text-decoration: none;">15</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> serial = "2019-<ins style="font-weight: bold; text-decoration: none;">07</ins>-<ins style="font-weight: bold; text-decoration: none;">17</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>--[=[</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>--[=[</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>Unit test for JSONutil</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>Unit test for JSONutil</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 16:</td> <td colspan="2" class="diff-lineno">Zeile 16:</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> { source = '{ "lineseps": "Ux\nstyle and\rApple and MS\r\nDOS" }',</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> { source = '{ "lineseps": "Ux\nstyle and\rApple and MS\r\nDOS" }',</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> second = '{ "lineseps": "Ux\\nstyle and\\nApple and MS\\nDOS" }' },</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> second = '{ "lineseps": "Ux\\nstyle and\\nApple and MS\\nDOS" }' },</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> { source = '{"<del style="font-weight: bold; text-decoration: none;">compact":"dense","packed</del>":true<del style="font-weight: bold; text-decoration: none;">}'</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> { source = '{<ins style="font-weight: bold; text-decoration: none;"> </ins>"<ins style="font-weight: bold; text-decoration: none;">commented</ins>":<ins style="font-weight: bold; text-decoration: none;"> </ins>true }<ins style="font-weight: bold; text-decoration: none;"> // line at end'</ins>,</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> second = '{ "commented": true }' },</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{ "commented":// line amid\n true// second line\n } ',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> second = '{ "commented": true }' },</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{ "commented": /* middle */true }',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> second = '{ "commented": true }' },</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{ "commented":/* middle */"edge" }',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> second = '{ "commented":"edge" }' },</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{ "NoComment": "An URL http://example.org/ is not a comment" }' },</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> { source = 'No JSON',</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> { source = 'No JSON',</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> status = 'Bracket0' },</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> status = 'Bracket0' },</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{ "simple": "assignment" } garbage',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> status = 'Trailing',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> second = 'garbage' },</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> { source = '{ "quoting": \'apostrophes\' }',</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> { source = '{ "quoting": \'apostrophes\' }',</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> status = 'Qoute',</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> status = 'Qoute',</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 41:</td> <td colspan="2" class="diff-lineno">Zeile 52:</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> second = ': true, }' },</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> second = ': true, }' },</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> { source = '{ "unclosed": true',</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> { source = '{ "unclosed": true',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> status = 'BracketCloseLack',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> second = '}' },</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{ "unclosed": "terminating"',</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> status = 'BracketCloseLack',</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> status = 'BracketCloseLack',</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> second = '}' },</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> second = '}' },</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 55:</td> <td colspan="2" class="diff-lineno">Zeile 69:</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> status = 'BracketClosePlus',</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> status = 'BracketClosePlus',</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> second = '2 ]' },</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> second = '2 ]' },</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> { source = '{"<del style="font-weight: bold; text-decoration: none;">compact":"dense","packed</del>":true<del style="font-weight: bold; text-decoration: none;">}</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> { source = '{<ins style="font-weight: bold; text-decoration: none;"> </ins>"<ins style="font-weight: bold; text-decoration: none;">commented</ins>":<ins style="font-weight: bold; text-decoration: none;"> /* middle </ins>true<ins style="font-weight: bold; text-decoration: none;"> </ins>}',</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> status = '<del style="font-weight: bold; text-decoration: none;">BracketClosePlus</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> status = '<ins style="font-weight: bold; text-decoration: none;">CommentEnd</ins>',</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> second = '}' }</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> second = '<ins style="font-weight: bold; text-decoration: none;">middle true </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>}</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>}</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 colspan="2" class="diff-lineno">Zeile 168:</td> <td colspan="2" class="diff-lineno">Zeile 182:</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> "BracketClosePlus",</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> "BracketClosePlus",</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> "CommaEnd",</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> "CommaEnd",</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> "CommentEnd",</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> "ControlChar",</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> "ControlChar",</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> "Qoute",</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> "Qoute",</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> "QouteEnd"<del style="font-weight: bold; text-decoration: none;"> }</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> "QouteEnd"<ins style="font-weight: bold; text-decoration: none;">,</ins></div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> "Trailing" }</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 r = ""</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 r = ""</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 s, s2</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 s, s2</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 201:</td> <td colspan="2" class="diff-lineno">Zeile 217:</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> s = mw.text.jsonEncode( e, mw.text.JSON_PRETTY )</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> s = mw.text.jsonEncode( e, mw.text.JSON_PRETTY )</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> s = mw.text.encode( s ):gsub( "\n", "&lt;br / &gt;" )</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> s = mw.text.encode( s ):gsub( "\n", "&lt;br / &gt;" )</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> :gsub( "://", "&amp;#58;//" )</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> e = mw.html.create( "span" )</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> e = mw.html.create( "span" )</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> :css( {["font-family"] = "monospace" } )</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> :css( {["font-family"] = "monospace" } )</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 226:</td> <td colspan="2" class="diff-lineno">Zeile 243:</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> xr = xr:gsub( xe[ at ], xe[ alter ] )</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> xr = xr:gsub( xe[ at ], xe[ alter ] )</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 -- for k</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 -- for k</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> xr = xr:gsub( "://", "&amp;#58;//" )</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> return xr</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> return xr</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 -- flip()</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 -- flip()</div></td> </tr> </table> PerfektesChaos https://de.wikipedia.org/w/index.php?title=Modul:JSONutil/test&diff=189105291&oldid=prev PerfektesChaos: + 2019-05-30T19:56:04Z <p>+</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="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 30. Mai 2019, 21:56 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 16:</td> <td colspan="2" class="diff-lineno">Zeile 16:</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> { source = '{ "lineseps": "Ux\nstyle and\rApple and MS\r\nDOS" }',</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> { source = '{ "lineseps": "Ux\nstyle and\rApple and MS\r\nDOS" }',</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> second = '{ "lineseps": "Ux\\nstyle and\\nApple and MS\\nDOS" }' },</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> second = '{ "lineseps": "Ux\\nstyle and\\nApple and MS\\nDOS" }' },</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{"compact":"dense","packed":true}' },</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> { source = 'No JSON',</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> { source = 'No JSON',</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> status = 'Bracket0' },</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> status = 'Bracket0' },</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 53:</td> <td colspan="2" class="diff-lineno">Zeile 54:</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> { source = '{ "unclosed": [ 42 ] ] ] }',</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> { source = '{ "unclosed": [ 42 ] ] ] }',</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> status = 'BracketClosePlus',</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> status = 'BracketClosePlus',</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> second = '2 ]' }</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> second = '2 ]' }<ins style="font-weight: bold; text-decoration: none;">,</ins></div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> { source = '{"compact":"dense","packed":true}}',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> status = 'BracketClosePlus',</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></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> second = '}' }</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>}</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>}</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> PerfektesChaos https://de.wikipedia.org/w/index.php?title=Modul:JSONutil/test&diff=188633149&oldid=prev PerfektesChaos: 2019-05-15 2019-05-16T13:49:38Z <p>2019-05-15</p> <p><b>Neue Seite</b></p><div>local Export = { suite = &quot;JSONutil&quot;,<br /> sub = &quot;test&quot;,<br /> serial = &quot;2019-05-15&quot; }<br /> --[=[<br /> Unit test for JSONutil<br /> =p.fiat()<br /> ]=]<br /> <br /> <br /> <br /> local Cases = {<br /> { source = &#039;{ &quot;simple&quot;: &quot;assignment&quot; }&#039; },<br /> { source = &#039;{ &quot;beg&quot;: &quot;\\&quot;escaped quote&quot;, &quot;mid&quot;: &quot;escaped\\&quot;quote&quot;, &quot;end&quot;: &quot;escaped quote\\&quot;&quot; }&#039; },<br /> { source = &#039;{ &quot;multiline&quot;: &quot;Some text\nin several lines\nalso with\ttabulator&quot; }&#039;,<br /> second = &#039;{ &quot;multiline&quot;: &quot;Some text\\nin several lines\\nalso with\\ttabulator&quot; }&#039; },<br /> { source = &#039;{ &quot;lineseps&quot;: &quot;Ux\nstyle and\rApple and MS\r\nDOS&quot; }&#039;,<br /> second = &#039;{ &quot;lineseps&quot;: &quot;Ux\\nstyle and\\nApple and MS\\nDOS&quot; }&#039; },<br /> { source = &#039;No JSON&#039;,<br /> status = &#039;Bracket0&#039; },<br /> { source = &#039;{ &quot;quoting&quot;: \&#039;apostrophes\&#039; }&#039;,<br /> status = &#039;Qoute&#039;,<br /> second = &quot;&#039;apostrophes&#039; }&quot; },<br /> { source = &#039;{ &quot;missing&quot;: &quot;qoute }&#039;,<br /> status = &#039;QouteEnd&#039;,<br /> second = &#039;qoute }&#039; },<br /> { source = &#039;{ &quot;missing&quot;: &quot;qoute (escaped)\\&quot; }&#039;,<br /> status = &#039;QouteEnd&#039;,<br /> second = &#039;qoute (escaped)\\&quot; }&#039; },<br /> { source = &#039;{ &quot;htab&quot;: &quot;h&#039; .. string.char( 8 ) .. &#039;tab&quot; }&#039;,<br /> status = &#039;ControlChar&#039;,<br /> second = &#039;tab&quot; }&#039; },<br /> { source = &#039;{ &quot;comma&quot;: &quot;trailing&quot;, }&#039;,<br /> status = &#039;CommaEnd&#039;,<br /> second = &#039;, }&#039; },<br /> { source = &#039;{ &quot;comma&quot;: [ &quot;trailing&quot;, ] }&#039;,<br /> status = &#039;CommaEnd&#039;,<br /> second = &#039;, ] }&#039; },<br /> { source = &#039;{ &quot;comma&quot;: true, }&#039;,<br /> status = &#039;CommaEnd&#039;,<br /> second = &#039;: true, }&#039; },<br /> { source = &#039;{ &quot;unclosed&quot;: true&#039;,<br /> status = &#039;BracketCloseLack&#039;,<br /> second = &#039;}&#039; },<br /> { source = &#039;{ { &quot;unclosed&quot;: 99&#039;,<br /> status = &#039;BracketCloseLack&#039;,<br /> second = &#039;2 }&#039; },<br /> { source = &#039;{ &quot;unclosed&quot;: [ 42 }&#039;,<br /> status = &#039;BracketCloseLack&#039;,<br /> second = &#039;]&#039; },<br /> { source = &#039;{ &quot;unclosed&quot;: [ 42 ] ] }&#039;,<br /> status = &#039;BracketClosePlus&#039;,<br /> second = &#039;]&#039; },<br /> { source = &#039;{ &quot;unclosed&quot;: [ 42 ] ] ] }&#039;,<br /> status = &#039;BracketClosePlus&#039;,<br /> second = &#039;2 ]&#039; }<br /> }<br /> <br /> <br /> <br /> local Codes = { { k = 9,<br /> s = &quot;\\t&quot;,<br /> say = &quot;Tab&quot; },<br /> { k = 10,<br /> s = &quot;\\n&quot;,<br /> say = &quot;LF&quot; } ,<br /> { k = 13,<br /> s = &quot;\\r&quot;,<br /> say = &quot;CR&quot; } }<br /> local Frame, Slang, Utility<br /> <br /> <br /> <br /> local function far()<br /> local r<br /> if not Slang then<br /> local o = mw.message.new( &quot;lang&quot; )<br /> if o:exists() then<br /> Slang = Frame:preprocess( &quot;{{int:lang}}&quot; )<br /> else<br /> local g, lucky, s, t<br /> Slang = true<br /> s = string.format( &quot;I18n/Module:%s.tab&quot;, Export.suite )<br /> lucky, t = pcall( mw.ext.data.get, s, &quot;_&quot; )<br /> lucky, g = pcall( require, &quot;Module:Multilingual&quot; )<br /> if type( g ) == &quot;table&quot; and<br /> type( g.Multilingual ) == &quot;function&quot; and<br /> type( t ) == &quot;table&quot; then<br /> local Multilingual = g.Multilingual()<br /> t = t.data<br /> if type( t ) == &quot;table&quot; and<br /> type( Multilingual.userLang ) == &quot;function&quot; then<br /> local e<br /> g = { }<br /> s = &quot;&quot;<br /> for i = 1, #t do<br /> e = t[ i ]<br /> if type( e ) == &quot;table&quot; and<br /> type( e[ 1 ] ) == &quot;string&quot; and<br /> e[ 1 ]:find( &quot;^err_&quot; ) and<br /> type( e[ 2 ] ) == &quot;table&quot; then<br /> e = e[ 2 ]<br /> if type( e ) == &quot;table&quot; then<br /> for k, v in pairs( e ) do<br /> if type( k ) == &quot;string&quot; and<br /> type( v ) == &quot;string&quot; then<br /> g[ k ] = true<br /> end<br /> end -- for k, v<br /> end<br /> end<br /> end -- for i<br /> for k, v in pairs( g ) do<br /> if s == &quot;&quot; then<br /> s = k<br /> else<br /> s = string.format( &quot;%s %s&quot;, s, k )<br /> end<br /> end -- for k, v<br /> Slang = Multilingual.userLang( s, Frame )<br /> end<br /> end<br /> end<br /> end<br /> if type( Slang ) == &quot;string&quot; then<br /> r = Slang<br /> end<br /> return r<br /> end -- far()<br /> <br /> <br /> <br /> local function father()<br /> local r<br /> if not Utility then<br /> local try = string.format( &quot;Module:%s&quot;, Export.suite )<br /> local lucky<br /> lucky, try = pcall( require, try )<br /> if type( try ) == &quot;table&quot; then<br /> if type( try.JSONutil ) == &quot;function&quot; then<br /> Utility = try.JSONutil()<br /> else<br /> r = string.format( &quot;%s bad init&quot;, Export.suite )<br /> end<br /> else<br /> r = try<br /> end<br /> if r then<br /> local e = mw.html.create( &quot;span&quot; )<br /> :addClass( &quot;error&quot; )<br /> :wikitext( r )<br /> r = tostring( e )<br /> end<br /> end<br /> return r<br /> end -- father()<br /> <br /> <br /> <br /> local function fault()<br /> -- Retrieve unit test result<br /> -- Returns string with wikisyntax<br /> local errors = { &quot;Bracket0&quot;,<br /> &quot;BracketCloseLack&quot;,<br /> &quot;BracketClosePlus&quot;,<br /> &quot;CommaEnd&quot;,<br /> &quot;ControlChar&quot;,<br /> &quot;Qoute&quot;,<br /> &quot;QouteEnd&quot; }<br /> local r = &quot;&quot;<br /> local s, s2<br /> for i = 1, #errors do<br /> s = errors[ i ]<br /> s2 = string.format( &quot;Trailing%d&quot;, i )<br /> r = string.format( &quot;%s\n; %s\n: %s&quot;,<br /> r, s, Utility.fault( s, s2, far() ) )<br /> end -- for i<br /> return r<br /> end -- fault()<br /> <br /> <br /> <br /> local function fetch()<br /> -- Retrieve unit test result<br /> -- Returns string with wikisyntax<br /> local r = &quot;&quot;<br /> local e, s<br /> for i = 1, #Cases do<br /> if i &gt; 1 then<br /> r = r .. &quot;\n----\n&quot;<br /> end<br /> e = Cases[ i ]<br /> e = Utility.fetch( e.source, true, far() )<br /> s = type( e )<br /> if s == &quot;string&quot; then<br /> r = r .. mw.text.encode( e )<br /> elseif s == &quot;table&quot; then<br /> s = mw.text.jsonEncode( e, mw.text.JSON_PRETTY )<br /> s = mw.text.encode( s ):gsub( &quot;\n&quot;, &quot;&lt;br / &gt;&quot; )<br /> e = mw.html.create( &quot;span&quot; )<br /> :css( {[&quot;font-family&quot;] = &quot;monospace&quot; } )<br /> :wikitext( s )<br /> r = r .. tostring( e )<br /> else<br /> r = string.format( &quot;%s%s %s&quot;, r, &quot;fetch() BAD TYPE:&quot;, s )<br /> end<br /> end -- for i<br /> return r<br /> end -- fetch()<br /> <br /> <br /> <br /> local function fiat()<br /> -- Retrieve unit test result<br /> -- Returns string with wikisyntax<br /> local scream = &quot;style=&#039;background:red&#039;&quot;<br /> local spaced = &quot;style=&#039;font-family:monospace&#039;&quot;<br /> local flip = function ( apply, at, alter )<br /> local xe<br /> local xr = apply:gsub( &quot;&#039;&#039;&quot;, &quot;&amp;apos;&amp;apos;&quot; )<br /> for k = 1, #Codes do<br /> xe = Codes[ k ]<br /> xr = xr:gsub( xe[ at ], xe[ alter ] )<br /> end -- for k<br /> return xr<br /> end -- flip()<br /> local r = &quot;{| class=&#039;wikitable&#039;\n&quot; ..<br /> &quot;|-\n&quot; ..<br /> &quot;! Input !! Code (fault) !! String (trailing)\n&quot;<br /> local e, legal, s, score, second, show, sign<br /> for i = 1, #Codes do<br /> e = Codes[ i ]<br /> e.str = string.char( e.k )<br /> e.sup = string.format( &quot;&lt;sup&gt;%s&lt;/sup&gt;&quot;, e.say )<br /> end -- for i<br /> for i = 1, #Cases do<br /> e = Cases[ i ]<br /> legal = true<br /> score, s = Utility.fair( e.source )<br /> if score then<br /> legal = ( score == e.status )<br /> if not legal then<br /> score = string.format( &quot;&#039;&#039;&#039;%s&#039;&#039;&#039;&quot;,<br /> e.status or &quot;unexpected&quot; )<br /> end<br /> elseif e.status then<br /> score = string.format( &quot;&amp;minus; %s&quot;, e.status )<br /> legal = false<br /> else<br /> score = &quot;&amp;#8211;&quot;<br /> end<br /> if legal then<br /> second = e.second or e.source<br /> legal = ( s == second )<br /> end<br /> if legal then<br /> sign = &quot;&quot;<br /> else<br /> sign = scream<br /> end<br /> show = flip( e.source, &quot;str&quot;, &quot;sup&quot; )<br /> s = flip( s, &quot;str&quot;, &quot;sup&quot; )<br /> r = string.format( &quot;%s|- %s\n|%s| %s\n| %s\n|%s| %s\n&quot;,<br /> r, sign, spaced, show, score, spaced, s )<br /> end -- for i<br /> r = r .. &quot;|}&quot;<br /> return r<br /> end -- fiat()<br /> <br /> <br /> <br /> -- Export<br /> local p = { }<br /> <br /> p.fault = function ( frame )<br /> Frame = frame<br /> return father() or fault()<br /> end<br /> <br /> p.fetch = function ( frame )<br /> Frame = frame<br /> return father() or fetch()<br /> end<br /> <br /> p.fiat = function ()<br /> return father() or fiat()<br /> end<br /> <br /> return p</div> PerfektesChaos