From 4908d2f94b1edccd3c673aba562b2b11eb3d8989 Mon Sep 17 00:00:00 2001 From: Alf Magne Kalleland Date: Mon, 18 Feb 2013 20:46:58 +0100 Subject: [PATCH] Added test for problematic pgn --- test/ParserTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/ParserTest.php b/test/ParserTest.php index 93fff3d..115f509 100644 --- a/test/ParserTest.php +++ b/test/ParserTest.php @@ -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';