[mcclim-cvs] CVS mcclim/Drei/Tests

thenriksen thenriksen at common-lisp.net
Tue Feb 13 12:14:12 UTC 2007


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

Modified Files:
	core-tests.lisp base-tests.lisp 
Log Message:
Fixed `delete-indentation', added `join-line' and exported some more
symbols from DREI-LISP-SYNTAX.


--- /project/mcclim/cvsroot/mcclim/Drei/Tests/core-tests.lisp	2007/02/12 19:32:57	1.2
+++ /project/mcclim/cvsroot/mcclim/Drei/Tests/core-tests.lisp	2007/02/13 12:14:11	1.3
@@ -383,7 +383,54 @@
     (delete-indentation *current-syntax* *current-point*)
     (buffer-is "   Foo  
 Bar
- Baz")))
+ Baz"))
+  (with-drei-environment (:initial-contents "
+foo bar")
+    (let ((start (clone-mark (point *current-window*)))
+          (end (clone-mark (point *current-window*)))
+          (orig-contents (buffer-contents)))
+      (beginning-of-buffer start)
+      (end-of-buffer end)
+      (do-buffer-region-lines (line start end)
+        (delete-indentation *current-syntax* line))
+      (buffer-is orig-contents))))
+
+(test join-line
+  (with-drei-environment (:initial-contents "
+        climacs   ")
+    (let ((m (clone-mark *current-point* :left)))
+      (setf (offset m) 3)
+      (join-line *current-syntax* m)
+      (is (= (offset m) 0))
+      (buffer-is "climacs   ")))
+  (with-drei-environment (:initial-contents "
+      climacs   ")
+    (let ((m (clone-mark *current-point* :right)))
+      (setf (offset m) 7)
+      (join-line *current-syntax* m)
+      (is (= (offset m) 0))
+      (buffer-is "climacs   ")))
+  (with-drei-environment (:initial-contents "   climacs   ")
+    (let ((m (clone-mark *current-point* :left)))
+      (setf (offset m) 7)
+      (join-line *current-syntax* m)
+      (is (= (offset m) 0))
+      (buffer-is "   climacs   ")))
+  (with-drei-environment (:initial-contents "climacs
+   climacs   ")
+    (let ((m (clone-mark *current-point* :right)))
+      (setf (offset m) 12)
+      (join-line *current-syntax* m)
+      (is (= (offset m) 8))
+      (buffer-is "climacs climacs   ")))
+  (with-drei-environment (:initial-contents "
+
+   climacs   ")
+    (let ((m (clone-mark *current-point* :right)))
+      (setf (offset m) 12)
+      (join-line *current-syntax* m)
+      (is (= (offset m) 0))
+      (buffer-is "climacs   "))))
 
 (test set-syntax
   (dolist (syntax-designator `("Lisp" drei-lisp-syntax::lisp-syntax
--- /project/mcclim/cvsroot/mcclim/Drei/Tests/base-tests.lisp	2006/12/04 07:54:51	1.1
+++ /project/mcclim/cvsroot/mcclim/Drei/Tests/base-tests.lisp	2007/02/13 12:14:11	1.2
@@ -607,53 +607,6 @@
       (is (string= (buffer-contents buffer)
                    #.(format nil "~A climacs   " #\Tab))))))
 
-(buffer-test delete-indentation
-  (let ((buffer (make-instance %%buffer)))
-    (insert-buffer-sequence buffer 0 "
-        climacs   ")
-    (let ((m (clone-mark (low-mark buffer) :left)))
-      (setf (offset m) 3)
-      (delete-indentation m)
-      (is (= (offset m) 0))
-      (is (string= (buffer-contents buffer)
-                   "climacs   ")))
-    (let ((buffer (make-instance %%buffer)))
-      (insert-buffer-sequence buffer 0 "
-      climacs   ")
-      (let ((m (clone-mark (low-mark buffer) :right)))
-        (setf (offset m) 7)
-        (delete-indentation m)
-        (is (= (offset m) 0))
-        (is (string= (buffer-contents buffer)
-                     "climacs   "))))
-    (let ((buffer (make-instance %%buffer)))
-      (insert-buffer-sequence buffer 0 "   climacs   ")
-      (let ((m (clone-mark (low-mark buffer) :left)))
-        (setf (offset m) 7)
-        (delete-indentation m)
-        (is (= (offset m) 0))
-        (is (string= (buffer-contents buffer)
-                     "   climacs   "))))
-    (let ((buffer (make-instance %%buffer)))
-      (insert-buffer-sequence buffer 0 "climacs
-   climacs   ")
-      (let ((m (clone-mark (low-mark buffer) :right)))
-        (setf (offset m) 12)
-        (delete-indentation m)
-        (is (= (offset m) 8))
-        (is (string= (buffer-contents buffer)
-                     "climacs climacs   "))))
-    (let ((buffer (make-instance %%buffer)))
-      (insert-buffer-sequence buffer 0 "
-
-   climacs   ")
-      (let ((m (clone-mark (low-mark buffer) :right)))
-        (setf (offset m) 12)
-        (delete-indentation m)
-        (is (= (offset m) 0))
-        (is (string= (buffer-contents buffer)
-                     "climacs   "))))))
-
 (buffer-test buffer-looking-at
   (let ((buffer (make-instance %%buffer)))
     (insert-buffer-sequence buffer 0 "climacs ")




More information about the Mcclim-cvs mailing list