-
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 test structure and refactor rays
Change-type: patch Signed-off-by: Giovanni Garufi <[email protected]>
- Loading branch information
Showing
6 changed files
with
56 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ dependencies: | |
- mtl | ||
- parsec | ||
- containers | ||
- HUnit | ||
|
||
library: | ||
source-dirs: src | ||
|
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 |
---|---|---|
@@ -1,2 +1,23 @@ | ||
import Test.HUnit | ||
|
||
import Fen | ||
import Board | ||
import GameTree | ||
|
||
depth :: Int | ||
depth = 5 | ||
|
||
main :: IO () | ||
main = putStrLn "Test suite not yet implemented" | ||
main = do | ||
runTestTT tests | ||
return () | ||
|
||
-- Siegbert Tarrasch vs. Max Kurschner | ||
-- 1. Qg6+ hxg6 2. Bxg6# | ||
mateInTwo = TestCase (assertEqual "1+2=3" move (Move (F,5) (G,6))) | ||
where | ||
board = fromFEN "r2qk2r/pb4pp/1n2Pb2/2B2Q2/p1p5/2P5/2B2PPP/RN2R1K1 w - - 1 0" | ||
(gs, _) = negamax board (active board) depth | ||
Just move = lastMove gs | ||
|
||
tests = TestList [TestLabel "mateInTwo" mateInTwo] |