https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3APgn%2Ftestcases Module:Pgn/testcases - Revision history 2025-06-04T04:20:17Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.3 https://en.wikipedia.org/w/index.php?title=Module:Pgn/testcases&diff=940153431&oldid=prev Pppery: Corrected module name 2020-02-10T21:11:26Z <p>Corrected 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 21:11, 10 February 2020</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;">LocationAndCountry</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;">Pgn</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;"><div>local pgnModule = require('Module:Pgn')</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 pgnModule = require('Module:Pgn')</div></td> </tr> </table> Pppery https://en.wikipedia.org/w/index.php?title=Module:Pgn/testcases&diff=861795616&oldid=prev Pppery: Pppery moved page Module:Pgn/Unit tests to Module:Pgn/testcases without leaving a redirect: Naming conventions 2018-09-30T02:27:48Z <p>Pppery moved page <a href="/w/index.php?title=Module:Pgn/Unit_tests&amp;action=edit&amp;redlink=1" class="new" title="Module:Pgn/Unit tests (page does not exist)">Module:Pgn/Unit tests</a> to <a href="/wiki/Module:Pgn/testcases" title="Module:Pgn/testcases">Module:Pgn/testcases</a> without leaving a redirect: Naming conventions</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <tr class="diff-title" lang="en"> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 02:27, 30 September 2018</td> </tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div> </td></tr></table> Pppery https://en.wikipedia.org/w/index.php?title=Module:Pgn/testcases&diff=853187030&oldid=prev קיפודנחש: tests 2018-08-03T01:00:04Z <p>tests</p> <p><b>New page</b></p><div>-- Unit tests for [[Module:LocationAndCountry]]. Click talk page to run tests.<br /> local p = require(&#039;Module:UnitTests&#039;)<br /> local pgnModule = require(&#039;Module:Pgn&#039;)<br /> <br /> -- test extraction of moves to FEN notation - main functionality of the module<br /> function p:testFullPgnMoves()<br /> local pgn=[[[Event &quot;World Cup&quot;]<br /> [Site &quot;Khanty-Mansiysk&quot;]<br /> [Date &quot;2007.11.25&quot;]<br /> [Round &quot;1.2&quot;]<br /> [White &quot;Mamedyarov, Shakhriyar&quot;]<br /> [Black &quot;Abdel Razik, Khaled&quot;]<br /> [Result &quot;1-0&quot;]<br /> [ECO &quot;D43&quot;]<br /> [WhiteElo &quot;2752&quot;]<br /> [BlackElo &quot;2389&quot;]<br /> [PlyCount &quot;65&quot;]<br /> [EventDate &quot;2007.11.24&quot;]<br /> [EventType &quot;k.o.&quot;]<br /> [EventRounds &quot;7&quot;]<br /> [EventCountry &quot;RUS&quot;]<br /> [Source &quot;ChessBase&quot;]<br /> [SourceDate &quot;2008.01.30&quot;]<br /> <br /> 1. d4 e6 2. c4 Nf6 3. Nf3 d5 4. Nc3 c6 5. Bg5 h6 6. Bxf6 Qxf6 7. Qc2 Nd7 8. e4<br /> dxe4 9. Qxe4 Bb4 10. Bd3 g6 11. O-O O-O 12. Qe3 Bxc3 13. bxc3 Kg7 14. a4 b6 15.<br /> a5 Ba6 16. Rfb1 Rfc8 17. h4 b5 18. cxb5 Bxb5 19. Bxb5 cxb5 20. Rxb5 Rab8 21.<br /> Rab1 Qf5 22. Rxb8 Rxb8 23. Rxb8 Nxb8 24. Ne5 h5 25. c4 f6 26. Qb3 fxe5 27. Qxb8<br /> exd4 28. Qxa7+ Kg8 29. Qb8+ Kh7 30. a6 d3 31. a7 d2 32. a8=Q d1=Q+ 33. Kh2 1-0<br /> ]]<br /> <br /> metadata, moves = pgnModule.main(pgn)<br /> <br /> self:preprocess_equals(<br /> moves[1],<br /> &#039;rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR&#039;<br /> )<br /> <br /> self:preprocess_equals(<br /> moves[#moves],<br /> &#039;QQ6/7k/4p1p1/5q1p/2P4P/8/5PPK/3q4&#039;<br /> )<br /> end<br /> <br /> --tests metadata extraction<br /> function p:testFullPgnMetadata()<br /> local pgn=[[[Event &quot;World Cup&quot;]<br /> [Site &quot;Khanty-Mansiysk&quot;]<br /> [Date &quot;2007.11.25&quot;]<br /> [Round &quot;1.2&quot;]<br /> [White &quot;Mamedyarov, Shakhriyar&quot;]<br /> [Black &quot;Abdel Razik, Khaled&quot;]<br /> [Result &quot;1-0&quot;]<br /> [ECO &quot;D43&quot;]<br /> [WhiteElo &quot;2752&quot;]<br /> [BlackElo &quot;2389&quot;]<br /> [PlyCount &quot;65&quot;]<br /> [EventDate &quot;2007.11.24&quot;]<br /> [EventType &quot;k.o.&quot;]<br /> [EventRounds &quot;7&quot;]<br /> [EventCountry &quot;RUS&quot;]<br /> [Source &quot;ChessBase&quot;]<br /> [SourceDate &quot;2008.01.30&quot;]<br /> <br /> 1. d4 e6 2. c4 Nf6 3. Nf3 d5 4. Nc3 c6 5. Bg5 h6 6. Bxf6 Qxf6 7. Qc2 Nd7 8. e4<br /> dxe4 9. Qxe4 Bb4 10. Bd3 g6 11. O-O O-O 12. Qe3 Bxc3 13. bxc3 Kg7 14. a4 b6 15.<br /> a5 Ba6 16. Rfb1 Rfc8 17. h4 b5 18. cxb5 Bxb5 19. Bxb5 cxb5 20. Rxb5 Rab8 21.<br /> Rab1 Qf5 22. Rxb8 Rxb8 23. Rxb8 Nxb8 24. Ne5 h5 25. c4 f6 26. Qb3 fxe5 27. Qxb8<br /> exd4 28. Qxa7+ Kg8 29. Qb8+ Kh7 30. a6 d3 31. a7 d2 32. a8=Q d1=Q+ 33. Kh2 1-0<br /> <br /> <br /> ]]<br /> metadata, moves = pgnModule.main(pgn)<br /> self:preprocess_equals( metadata[&#039;Black&#039;] or &#039;&#039;, &#039;Abdel Razik, Khaled&#039; )<br /> self:preprocess_equals( metadata[&#039;White&#039;] or &#039;&#039;, &#039;Mamedyarov, Shakhriyar&#039; )<br /> end<br /> <br /> -- tests algebric notation PGN with no metadata<br /> function p:testAlgebricNotation()<br /> local pgn=[[1. d4 e6 2. c4 Nf6 3. Nf3 d5 4. Nc3 c6 5. Bg5 h6 6. Bxf6 Qxf6 7. Qc2 Nd7 8. e4<br /> dxe4 9. Qxe4 Bb4 10. Bd3 g6 11. O-O O-O 12. Qe3 Bxc3 13. bxc3 Kg7 14. a4 b6 15.<br /> a5 Ba6 16. Rfb1 Rfc8 17. h4 b5 18. cxb5 Bxb5 19. Bxb5 cxb5 20. Rxb5 Rab8 21.<br /> Rab1 Qf5 22. Rxb8 Rxb8 23. Rxb8 Nxb8 24. Ne5 h5 25. c4 f6 26. Qb3 fxe5 27. Qxb8<br /> exd4 28. Qxa7+ Kg8 29. Qb8+ Kh7 30. a6 d3 31. a7 d2 32. a8=Q d1=Q+ 33. Kh2 1-0<br /> ]]<br /> local metadata, moves<br /> success, metadata, moves = pcall(pgnModule.main,pgn)<br /> if not success then<br /> moves = {&#039;fail&#039;}<br /> end<br /> <br /> self:preprocess_equals(<br /> moves[1],<br /> &#039;rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR&#039;<br /> )<br /> <br /> self:preprocess_equals(<br /> moves[#moves],<br /> &#039;QQ6/7k/4p1p1/5q1p/2P4P/8/5PPK/3q4&#039;<br /> )<br /> end<br /> <br /> return p</div> קיפודנחש