Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Dec 20, 2024
1 parent 7e250b1 commit c226756
Showing 1 changed file with 168 additions and 0 deletions.
168 changes: 168 additions & 0 deletions tests/unit/SanSignalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,172 @@ public function A59()

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function a4()
{
$expectedSignal = [ 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.a4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function b4()
{
$expectedSignal = [ 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.b4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function c4()
{
$expectedSignal = [ 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.c4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function d4()
{
$expectedSignal = [ 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.d4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function e4()
{
$expectedSignal = [ 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.e4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function f4()
{
$expectedSignal = [ 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.f4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function g4()
{
$expectedSignal = [ 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.g4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function h4()
{
$expectedSignal = [ 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.h4';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function a4_h5()
{
$expectedSignal = [ 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.a4 h5';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function a4_a5()
{
$expectedSignal = [ 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.a4 a5';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function a4_e5()
{
$expectedSignal = [ 0.0, 2.0, -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.a4 e5';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}

/**
* @test
*/
public function h4_e5()
{
$expectedSignal = [ 0.0, 2.0, -3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];

$movetext = '1.h4 e5';

$sanSignal = new SanSignal(self::$function, $movetext, new Board());

$this->assertEquals($expectedSignal, $sanSignal->signal);
}
}

0 comments on commit c226756

Please sign in to comment.