Added test for problematic pgn

This commit is contained in:
Alf Magne Kalleland
2013-02-18 20:46:58 +01:00
parent ee52853327
commit 4908d2f94b

View File

@@ -1803,6 +1803,21 @@ class ParserTest extends PHPUnit_Framework_TestCase
$this->assertEquals(52, count($game['moves']));
}
/**
* @test
*/
public function shouldParseProblematicGame3(){
// given
$pgnParser = new PgnParser("pgn/problematic.pgn");
// when
$game = $pgnParser->getGameByIndex(3);
// then
$this->assertEquals(82, 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';