|
24 | 24 |
|
25 | 25 | (deftest perft-test |
26 | 26 | (testing "Default fen" |
27 | | - (is (= (let [state (fen->state "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")] |
28 | | - (mapv #(perft state %) [1 2 3])) |
| 27 | + (is (let [state (fen->state "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")] |
| 28 | + (= (mapv #(perft state %) [1 2 3])) |
29 | 29 | [20 400 8902]))) |
30 | 30 | (testing "Kiwipete" |
31 | | - (is (= (let [state (fen->state "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1")] |
32 | | - (mapv #(perft state %) [1 2 3])) |
| 31 | + (is (let [state (fen->state "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1")] |
| 32 | + (= (mapv #(perft state %) [1 2 3])) |
33 | 33 | [48 2039 97862]))) |
34 | 34 | (testing "Position 3" |
35 | | - (is (= (let [state (fen->state "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1")] |
36 | | - (mapv #(perft state %) [1 2 3 4])) |
| 35 | + (is (let [state (fen->state "8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1")] |
| 36 | + (= (mapv #(perft state %) [1 2 3 4])) |
37 | 37 | [14 191 2812 43238]))) |
38 | 38 | (testing "Position 4" |
39 | | - (is (= (let [state (fen->state "r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1")] |
40 | | - (mapv #(perft state %) [1 2 3])) |
| 39 | + (is (let [state (fen->state "r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1")] |
| 40 | + (= (mapv #(perft state %) [1 2 3])) |
41 | 41 | [6 264 9467]))) |
42 | 42 | (testing "Position 5" |
43 | | - (is (= (let [state (fen->state "rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8")] |
44 | | - (mapv #(perft state %) [1 2 3])) |
| 43 | + (is (let [state (fen->state "rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8")] |
| 44 | + (= (mapv #(perft state %) [1 2 3])) |
45 | 45 | [44 1486 62379]))) |
46 | 46 | (testing "Position 6" |
47 | | - (is (= (let [state (fen->state "r4rk1/1pp1qppp/p1np1n2/2b1p1B1/2B1P1b1/P1NP1N2/1PP1QPPP/R4RK1 w - - 0 10")] |
48 | | - (mapv #(perft state %) [1 2 3])) |
| 47 | + (is (let [state (fen->state "r4rk1/1pp1qppp/p1np1n2/2b1p1B1/2B1P1b1/P1NP1N2/1PP1QPPP/R4RK1 w - - 0 10")] |
| 48 | + (= (mapv #(perft state %) [1 2 3])) |
49 | 49 | [46 2079 89890])))) |
50 | 50 |
|
51 | 51 | (run-tests) |
0 commit comments