Skip to content

Commit

Permalink
Add FEN::copy test.
Browse files Browse the repository at this point in the history
  • Loading branch information
onspli committed Sep 17, 2021
1 parent cf6de1a commit a424d80
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit/FENTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ public function testStringable() : void
$this->assertEquals('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', (string) $fen);
}

public function testCopy() : void
{
$fen = new FEN;
$fen2 = $fen->copy();
$fen->set_square('e4', 'Q');
$fen->set_fullmove(5);
$this->assertEquals('', $fen2->get_square('e4'));
$this->assertEquals(1, $fen2->get_fullmove());
}

public function testSetFullmoveInvalid1() : void
{
$this->expectException(ParseException::class);
Expand Down

0 comments on commit a424d80

Please sign in to comment.