Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Jan 27, 2025
1 parent 1ccefb8 commit e696d75
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/unit/Variant/Classical/BoardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2892,4 +2892,44 @@ public function play_lan_pawn_promotion()

$this->assertSame($expected, $board->movetext());
}

/**
* @test
*/
public function e4_h6_e5_f5_h3_h5_exf6()
{
$expected = ['e6'];

$board = new Board();

$board->play('w', 'e4');
$board->play('b', 'h6');
$board->play('w', 'e5');
$board->play('b', 'f5');
$board->play('w', 'h3');
$board->play('b', 'h5');

$this->assertEquals($expected, $board->legal('e5'));
$this->assertFalse($board->play('w', 'exf6'));
}

/**
* @test
*/
public function e2e4_h7h6_e4e5_f7f5_h2h3_h6h5_e5f6()
{
$expected = ['e6'];

$board = new Board();

$board->playLan('w', 'e2e4');
$board->playLan('b', 'h7h6');
$board->playLan('w', 'e4e5');
$board->playLan('b', 'f7f5');
$board->playLan('w', 'h2h3');
$board->playLan('b', 'h6h5');

$this->assertEquals($expected, $board->legal('e5'));
$this->assertFalse($board->playLan('w', 'e5f6'));
}
}

0 comments on commit e696d75

Please sign in to comment.