-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove specs2, all tests are now on munit
- Loading branch information
Showing
6 changed files
with
37 additions
and
72 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 |
---|---|---|
@@ -1,30 +1,27 @@ | ||
// package chess | ||
// package perft | ||
// | ||
// import org.specs2.specification.core.Fragments | ||
// | ||
// import chess.variant.* | ||
// | ||
// class PerftTest extends ChessTest: | ||
// | ||
// private def genTests(name: String, tests: List[Perft], variant: Variant, nodeLimit: Long): Fragments = | ||
// name should: | ||
// Fragments.foreach(tests) { perft => | ||
// perft.id in: | ||
// val result = perft.withLimit(nodeLimit).calculate(variant) | ||
// Fragments.foreach(result) { r => | ||
// s"${r.depth}" in { r.result must_== r.expected } | ||
// } | ||
// } | ||
// | ||
// val nodeLimits = 1_000_000L | ||
// genTests("calculate ThreeCheck perfts", Perft.threeCheckPerfts, ThreeCheck, nodeLimits) | ||
// genTests("calculate Antichess perfts", Perft.antichessPerfts, Antichess, nodeLimits) | ||
// genTests("calculate Atomic perfts", Perft.atomicPerfts, Atomic, nodeLimits) | ||
// genTests("calculate Crazyhouse perfts", Perft.crazyhousePerfts, Crazyhouse, nodeLimits) | ||
// genTests("calculate Horde perfts", Perft.hordePerfts, Horde, nodeLimits) | ||
// genTests("calculate RacingKings perfts", Perft.racingkingsPerfts, RacingKings, nodeLimits) | ||
// // for the shake of time we only test the first 50 cases in random.peft, run FullRandomPerftTest.scala for all cases | ||
// genTests("calculate random perfts", Perft.randomPerfts.take(100), Chess960, nodeLimits) | ||
// genTests("calculate tricky perfts", Perft.trickyPerfts, Chess960, nodeLimits) | ||
// genTests("calculate chess960 perfts", Perft.chess960, Chess960, nodeLimits) | ||
package chess | ||
package perft | ||
|
||
import chess.variant.* | ||
|
||
class PerftTest extends ChessTest: | ||
|
||
private def genTests(name: String, tests: List[Perft], variant: Variant, nodeLimit: Long)(using | ||
munit.Location | ||
) = | ||
tests.foreach: perft => | ||
val result = perft.withLimit(nodeLimit).calculate(variant) | ||
result.foreach: r => | ||
test(s"$name ${perft.id} depth: ${r.depth}"): | ||
assertEquals(r.result, r.expected) | ||
|
||
val nodeLimits = 1_000_000L | ||
genTests("calculate ThreeCheck perfts", Perft.threeCheckPerfts, ThreeCheck, nodeLimits) | ||
genTests("calculate Antichess perfts", Perft.antichessPerfts, Antichess, nodeLimits) | ||
genTests("calculate Atomic perfts", Perft.atomicPerfts, Atomic, nodeLimits) | ||
genTests("calculate Crazyhouse perfts", Perft.crazyhousePerfts, Crazyhouse, nodeLimits) | ||
genTests("calculate Horde perfts", Perft.hordePerfts, Horde, nodeLimits) | ||
genTests("calculate RacingKings perfts", Perft.racingkingsPerfts, RacingKings, nodeLimits) | ||
// for the shake of time we only test the first 50 cases in random.peft, run FullRandomPerftTest.scala for all cases | ||
genTests("calculate random perfts", Perft.randomPerfts.take(100), Chess960, nodeLimits) | ||
genTests("calculate tricky perfts", Perft.trickyPerfts, Chess960, nodeLimits) | ||
genTests("calculate chess960 perfts", Perft.chess960, Chess960, nodeLimits) |