[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 38/255: more capture tests, failing multistone captures
From: |
Eric Schulte |
Subject: |
[elpa] 38/255: more capture tests, failing multistone captures |
Date: |
Sun, 16 Mar 2014 01:02:14 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 6bcc04a8149db051aac270ad16572e965dc347e2
Author: Eric Schulte <address@hidden>
Date: Thu May 17 16:43:32 2012 -0400
more capture tests, failing multistone captures
---
sgf-files/1-capture.sgf | 6 ++++++
sgf-files/2-capture.sgf | 11 +++++++++++
sgf.el | 14 +++++++++++---
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/sgf-files/1-capture.sgf b/sgf-files/1-capture.sgf
new file mode 100644
index 0000000..6eb6f19
--- /dev/null
+++ b/sgf-files/1-capture.sgf
@@ -0,0 +1,6 @@
+(;EV[simple 1-stone capture]
+ S[4]
+ C[Here is a simple 1-stone capture used mainly as an example in tests.]
+ ;B[ba]
+ ;W[aa]
+ ;B[ab])
diff --git a/sgf-files/2-capture.sgf b/sgf-files/2-capture.sgf
new file mode 100644
index 0000000..3379e3e
--- /dev/null
+++ b/sgf-files/2-capture.sgf
@@ -0,0 +1,11 @@
+(;EV[simple 2-stone capture]
+ S[4]
+ C[Here is a simple 2-stone capture used mainly as an example in tests.]
+ ;B[ac]
+ ;B[ab]
+ ;B[ba]
+ ;B[cb]
+ ;B[cc]
+ ;W[bb]
+ ;W[bc]
+ ;B[bd])
diff --git a/sgf.el b/sgf.el
index 0c1af36..64bbb12 100644
--- a/sgf.el
+++ b/sgf.el
@@ -603,6 +603,12 @@
(should (= 4 (length (neighbors board (/ (length board) 2)))))
(should (= 3 (length (neighbors board 1))))))
+(ert-deftest sgf-singl-stone-capture ()
+ (flet ((counts () (cons (stones-for local-board :b)
+ (stones-for local-board :w))))
+ (with-sgf-file "sgf-files/1-capture.sgf"
+ (right 3) (should (tree-equal (counts) '(2 . 0))))))
+
(ert-deftest sgf-remove-dead-stone-ko ()
(flet ((counts () (cons (stones-for local-board :b)
(stones-for local-board :w))))
@@ -617,6 +623,8 @@
(should (tree-equal (counts) '(3 . 2))) (right 1)
(should (tree-equal (counts) '(2 . 3))))))
-;; (ert-deftest sgf-remove-dead-stone () )
-
-;; (ert-deftest sgf-remove-dead-stone-dragon () )
+(ert-deftest sgf-two-stone-capture ()
+ (flet ((counts () (cons (stones-for local-board :b)
+ (stones-for local-board :w))))
+ (with-sgf-file "sgf-files/2-capture.sgf"
+ (right 8) (should (tree-equal (counts) '(6 . 0))))))
- [elpa] 28/255: adding a major mode for board navigation keys, (continued)
- [elpa] 28/255: adding a major mode for board navigation keys, Eric Schulte, 2014/03/15
- [elpa] 27/255: implementation notes, Eric Schulte, 2014/03/15
- [elpa] 31/255: a test to protect against unwanted state changes, Eric Schulte, 2014/03/15
- [elpa] 33/255: removing dead pieces after moves, Eric Schulte, 2014/03/15
- [elpa] 35/255: compiled and caught some minor issues, Eric Schulte, 2014/03/15
- [elpa] 32/255: consolidating utility functions, Eric Schulte, 2014/03/15
- [elpa] 30/255: saving the board configuration with each sgf step, Eric Schulte, 2014/03/15
- [elpa] 18/255: applying moves to a board, Eric Schulte, 2014/03/15
- [elpa] 37/255: remove debug printf, Eric Schulte, 2014/03/15
- [elpa] 34/255: beginning to stub out tests for dead stone removal, Eric Schulte, 2014/03/15
- [elpa] 38/255: more capture tests, failing multistone captures,
Eric Schulte <=
- [elpa] 36/255: passing all tests (at least it did this once), Eric Schulte, 2014/03/15
- [elpa] 26/255: improvements, considering labels and moves, Eric Schulte, 2014/03/15
- [elpa] 40/255: parsing empty properties, Eric Schulte, 2014/03/15
- [elpa] 42/255: more work with tree parsing, Eric Schulte, 2014/03/15
- [elpa] 46/255: TODO: try using load-read-function and try loading these files w/read, Eric Schulte, 2014/03/15
- [elpa] 45/255: looking at a new method of parsing trees, Eric Schulte, 2014/03/15
- [elpa] 44/255: indentation, Eric Schulte, 2014/03/15
- [elpa] 43/255: paren matching, Eric Schulte, 2014/03/15
- [elpa] 49/255: removed debug stuffs, Eric Schulte, 2014/03/15
- [elpa] 47/255: parsing of sgf files with alternative paths working, Eric Schulte, 2014/03/15