-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enpassant rules to getCapturesInOrder
- Loading branch information
1 parent
a8b2346
commit 5111048
Showing
6 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package search | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/dylhunn/dragontoothmg" | ||
"go.janniklasrichter.de/axwchessbot/game" | ||
) | ||
|
||
func Test_isCaptureOrPromotionMove(t *testing.T) { | ||
type args struct { | ||
game *game.Game | ||
move dragontoothmg.Move | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want bool | ||
}{ | ||
{"En Passant", args{game.NewFromFen("rnbqkbnr/pp3ppp/3p4/3Pp3/1Pp1P3/5P2/P1P3PP/RNBQKBNR b KQkq b3 0 5"), getMove("c4b3")}, true}, | ||
{"Missed En Passant", args{game.NewFromFen("rnbqkbnr/pp4pp/3p1p2/3Pp3/1Pp1P3/5P1N/P1P3PP/RNBQKB1R b KQkq - 1 6"), getMove("c4b3")}, false}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := isCaptureOrPromotionMove(tt.args.game, tt.args.move); got != tt.want { | ||
t.Errorf("isCaptureOrPromotionMove() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |