summaryrefslogtreecommitdiff
path: root/chess-perft.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2014-04-21 11:24:48 +0200
committerMario Lang <mlang@delysid.org>2014-04-21 11:24:48 +0200
commit51a97cafe5d46d948b1adecb76c709724de73af2 (patch)
tree041bf3a39e5885e68a0d5a330b3a1d087136d61d /chess-perft.el
parent96d8fbc12ce174e435a83fc69b0cc7a0b8f914e6 (diff)
chess-perft.el: Add another test case with depth 5.
Now that our execution time has been reduced significantly, add a bigger test case to improve the testsuite coverage. "make perft" now takes 10m33s.
Diffstat (limited to 'chess-perft.el')
-rw-r--r--chess-perft.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/chess-perft.el b/chess-perft.el
index 2562120..673ce9e 100644
--- a/chess-perft.el
+++ b/chess-perft.el
@@ -87,7 +87,7 @@ If not called interactively the result is a list of the form
(let ((progress (when (called-interactively-p 'any)
(make-progress-reporter "Perft... " 0 (length plies))))
(index 0))
- (when (= depth 3) (accept-process-output))
+ (when (and (not noninteractive) (= depth 2)) (accept-process-output))
(dolist (ply plies)
(unless (chess-ply-final-p ply)
(cl-multiple-value-bind (n c e ca p ch cm)
@@ -125,6 +125,10 @@ If not called interactively the result is a list of the form
:tags '(:capture :check :checkmate)
(should (equal (chess-perft (chess-pos-create) 4) '(197281 1576 0 0 0 469 8))))
+(ert-deftest chess-perft-startpos-depth5 ()
+ :tags '(:capture :en-passant :check :checkmate)
+ (should (equal (chess-perft (chess-pos-create) 5) '(4865609 82719 258 0 0 27351 347))))
+
(ert-deftest chess-perft-kiwipete-depth1 ()
:tags '(:capture :castle)
(let ((position