[mcclim-cvs] CVS mcclim/Drei/Tests

thenriksen thenriksen at common-lisp.net
Sat Jan 5 21:07:16 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Drei/Tests
In directory clnet:/tmp/cvs-serv23302/Drei/Tests

Modified Files:
	lisp-syntax-tests.lisp motion-tests.lisp 
Log Message:
Made Backward Expression behave more like Emacs.

Also added a currently-failing test case for Forward Expression, I
couldn't figure out a simple way to handle the situation, and I fear
special-casing will be necessary.


--- /project/mcclim/cvsroot/mcclim/Drei/Tests/lisp-syntax-tests.lisp	2007/12/20 10:33:35	1.10
+++ /project/mcclim/cvsroot/mcclim/Drei/Tests/lisp-syntax-tests.lisp	2008/01/05 21:07:16	1.11
@@ -823,7 +823,11 @@
 (motion-fun-one-test (expression lisp-syntax)
   (51 0 (11 28 7)
       "(defun list (&rest elements)
-(append elements nil))"))
+(append elements nil))")
+  (nil nil (5 18 9)
+      "#+nil (list 1 2 3)")
+  (nil nil (0 5 nil)
+      "#+nil (list 1 2 3)"))
 
 (motion-fun-one-test (list lisp-syntax)
   (64 4 (22 41 11)
--- /project/mcclim/cvsroot/mcclim/Drei/Tests/motion-tests.lisp	2007/12/20 10:33:35	1.7
+++ /project/mcclim/cvsroot/mcclim/Drei/Tests/motion-tests.lisp	2008/01/05 21:07:16	1.8
@@ -105,8 +105,8 @@
                        (check-type forward-begin-offset (or integer null))
                        (check-type backward-end-offset (or integer null))
                        (check-type offset integer)
-                       (check-type goal-forward-offset integer)
-                       (check-type goal-backward-offset integer)
+                       (check-type goal-forward-offset (or integer null))
+                       (check-type goal-backward-offset (or integer null))
                        `(with-buffer (buffer :initial-contents ,initial-contents)
                           (with-view (view :buffer buffer :syntax ',syntax)
                             (let ((syntax (syntax view))
@@ -117,7 +117,8 @@
                                   (m2l (make-buffer-mark buffer (size buffer) :left))
                                   (m2r (make-buffer-mark buffer (size buffer) :right)))
                               (declare (ignore ,@(unless forward-begin-offset '(m0l))
-                                               ,@(unless backward-end-offset '(m0r))))
+                                               ,@(unless backward-end-offset '(m0r))
+                                               ,@(unless goal-forward-offset '(m0r m1l))))
                               ,(when forward-begin-offset
                                      `(progn
                                         (is-true (,forward m0l syntax))
@@ -126,10 +127,14 @@
                                      `(progn
                                         (is-true (,forward m0r syntax))
                                         (is (= ,forward-begin-offset (offset m0r)))))
-                              (is-true (,forward m1l syntax))
-                              (is (= ,goal-forward-offset (offset m1l)))
-                              (is-true (,forward m1r syntax))
-                              (is (= ,goal-forward-offset (offset m1r)))
+                              ,(unless (null goal-forward-offset)
+                                       `(progn
+                                          (is-true (,forward m1l syntax))
+                                          (is (= ,goal-forward-offset (offset m1l)))))
+                              ,(unless (null goal-forward-offset)
+                                       `(progn
+                                          (is-true (,forward m1r syntax))
+                                          (is (= ,goal-forward-offset (offset m1r)))))
                               (is-false (,forward m2l syntax))
                               (is (= (size buffer) (offset m2l)))
                               (is-false (,forward m2r syntax))
@@ -152,15 +157,20 @@
                                   (m1r (make-buffer-mark buffer ,offset :right))
                                   (m2l (make-buffer-mark buffer (size buffer) :left))
                                   (m2r (make-buffer-mark buffer (size buffer) :right)))
-                              (declare (ignore ,@(unless backward-end-offset '(m2l m2r))))
+                              (declare (ignore ,@(unless backward-end-offset '(m2l m2r))
+                                               ,@(unless goal-backward-offset '(m1l m1r))))
                               (is-false (,backward m0l syntax))
                               (is (= 0 (offset m0l)))
                               (is-false (,backward m0r syntax))
                               (is (= 0 (offset m0r)))
-                              (is-true (,backward m1l syntax))
-                              (is (= ,goal-backward-offset (offset m1l)))
-                              (is-true (,backward m1r syntax))
-                              (is (= ,goal-backward-offset (offset m1r)))
+                              ,(unless (null goal-backward-offset)
+                                       `(progn
+                                          (is-true (,backward m1l syntax))
+                                          (is (= ,goal-backward-offset (offset m1l)))))
+                              ,(unless (null goal-backward-offset)
+                                       `(progn
+                                          (is-true (,backward m1r syntax))
+                                          (is (= ,goal-backward-offset (offset m1r)))))
                               ,(when backward-end-offset
                                      `(progn
                                         (is-true (,backward m2l syntax))




More information about the Mcclim-cvs mailing list