https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ATiming%2Ftestcases Module:Timing/testcases - Revision history 2025-05-27T19:44:45Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.2 https://en.wikipedia.org/w/index.php?title=Module:Timing/testcases&diff=700173467&oldid=prev Jeblad at 21:41, 16 January 2016 2016-01-16T21:41:39Z <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="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 21:41, 16 January 2016</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"></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>require 'Module:BDD'()</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>require 'Module:BDD'()</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>local p = require('Module:<del style="font-weight: bold; text-decoration: none;">Profile</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>local p = require('Module:<ins style="font-weight: bold; text-decoration: none;">Timing</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;"><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>describe({en='statistical analysis', nb='statistisk analyse'}, function()</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>describe({en='statistical analysis', nb='statistisk analyse'}, function()</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Line 40:</td> <td colspan="2" class="diff-lineno">Line 40:</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" 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>return result('Module:<del style="font-weight: bold; text-decoration: none;">Profile</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>return result('Module:<ins style="font-weight: bold; text-decoration: none;">Timing</ins>')</div></td> </tr> </table> Jeblad https://en.wikipedia.org/w/index.php?title=Module:Timing/testcases&diff=700173313&oldid=prev Jeblad: BDD is not available for the moment, stay tuned, it will arrive at a wiki nearby you... 2016-01-16T21:40:11Z <p>BDD is not available for the moment, stay tuned, it will arrive at a wiki nearby you...</p> <p><b>New page</b></p><div>require &#039;Module:BDD&#039;()<br /> local p = require(&#039;Module:Profile&#039;)<br /> <br /> describe({en=&#039;statistical analysis&#039;, nb=&#039;statistisk analyse&#039;}, function()<br /> context({en=&#039;for a constant serie&#039;, nb=&#039;for en konstant serie&#039;}, function()<br /> it({en=&#039;should give mean&#039;, nb=&#039;skal finnes middelverdi&#039;}, function()<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ -1, -1, -1 })[1]):toBe( -1 )<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ 0, 0 })[1]):toBe( 0 )<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ 2, 2, 2, 2 })[1]):toBe( 2 )<br /> end)<br /> it({en=&#039;should give variance&#039;, nb=&#039;skal finnes varians&#039;}, function()<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ -1, -1, -1 })[2]):toBe( 0 )<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ 0, 0 })[2]):toBe( 0 )<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ 2, 2, 2, 2 })[2]):toBe( 0 )<br /> end)<br /> end)<br /> context({en=&#039;for an alternating serie&#039;, nb=&#039;for en vekslende serie&#039;}, function()<br /> it({en=&#039;should give mean&#039;, nb=&#039;skal finnes middelverdi&#039;}, function()<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ -1, -1, 1, 1 })[1]):toBe( 0 )<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ 2, 2, 4, 4 })[1]):toBe( 3 )<br /> end)<br /> it({en=&#039;should give variance&#039;, nb=&#039;skal finnes varians&#039;}, function()<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ -1, -1, 1, 1 })[2]):toBe( 1 )<br /> expect(&#039;&quot;p.stats&quot;&#039;, p.stats({ 2, 2, 4, 4 })[2]):toBe( 1 )<br /> end)<br /> end)<br /> end)<br /> <br /> describe({en=&#039;difference against a baseline&#039;, nb=&#039;forskjell mot en grunnlinje&#039;}, function()<br /> context({en=&#039;for equal pairs&#039;, nb=&#039;for like par&#039;}, function()<br /> it({en=&#039;should give mean&#039;, nb=&#039;skal finnes middelverdi&#039;}, function()<br /> expect(&#039;&quot;p.combine&quot;&#039;, p.combine({ -1, 0 }, { -1, 0 })[1]):toBe( 0 )<br /> expect(&#039;&quot;p.combine&quot;&#039;, p.combine({ 2, 1 }, { 2, 1 })[1]):toBe( 0 )<br /> end)<br /> it({en=&#039;should give variance&#039;, nb=&#039;skal finnes varians&#039;}, function()<br /> expect(&#039;&quot;p.combine&quot;&#039;, p.combine({ -1, 0 }, { -1, 0 })[2]):toBe( 0 )<br /> expect(&#039;&quot;p.combine&quot;&#039;, p.combine({ 2, 1 }, { 2, 1 })[2]):toBe( math.pow(2, 0.5) )<br /> end)<br /> end)<br /> end)<br /> <br /> return result(&#039;Module:Profile&#039;)</div> Jeblad