test of problemating pgn

This commit is contained in:
Alf Magne Kalleland
2013-02-12 00:58:18 +01:00
parent 61e2159841
commit b437127f6b
4 changed files with 102 additions and 16 deletions

View File

@@ -4,10 +4,10 @@
* User: Alf Magne
* Date: 03.11.12
* Time: 19:50
* To change$this template use File | Settings | File Templates.
*
*/
require_once(__DIR__."/../autoload.php");
require_once(__DIR__."/../../autoload.php");
class ParserTest extends PHPUnit_Framework_TestCase
@@ -1774,6 +1774,21 @@ class ParserTest extends PHPUnit_Framework_TestCase
}
/**
* @test
*/
public function shouldParseProblematicGame(){
// given
$pgnParser = new PgnParser("pgn/problematic.pgn");
// when
$game = $pgnParser->getFirstGame();
// then
$this->assertEquals((36*2)+1, count($game['moves']));
}
private function getSpasskyFischerGameWith3FoldReptition(){
$parser = $this->getParser();
$moves = 'e4,d6,d4,g6,Nc3,Nf6,f4,Bg7,Nf3,c5,dxc5,Qa5,Bd3,Qxc5,Qe2,O-O,Be3,Qa5,O-O,Bg4,Rad1,Nc6,Bc4,Nh5,Bb3,Bxc3,bxc3,Qxc3,f5,Nf6,h3,Bxf3,Qxf3,Na5,Rd3,Qc7,Bh6,Nxb3,cxb3,Qc5+,Kh1,Qe5,Bxf8,Rxf8,Re3,Rc8,fxg6,hxg6,Qf4,Qxf4,Rxf4,Nd7,Rf2,Ne5,Kh2,Rc1,Ree2,Nc6,Rc2,Re1,Rfe2,Ra1,Kg3,Kg7,Rcd2,Rf1,Rf2,Re1,Rfe2,Rf1,Re3,a6,Rc3,Re1,Rc4,Rf1,Rdc2,Ra1,Rf2,Re1,Rfc2,g5,Rc1,Re2,R1c2,Re1,Rc1,Re2,R1c2';