[mcclim-cvs] CVS mcclim/Drei/Tests

thenriksen thenriksen at common-lisp.net
Thu Jan 31 08:34:15 UTC 2008


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

Modified Files:
	core-tests.lisp 
Log Message:
Put point at offset 0, even if there are initial contents.

Made some tests run.


--- /project/mcclim/cvsroot/mcclim/Drei/Tests/core-tests.lisp	2008/01/19 20:06:01	1.7
+++ /project/mcclim/cvsroot/mcclim/Drei/Tests/core-tests.lisp	2008/01/31 08:34:15	1.8
@@ -27,42 +27,6 @@
 
 (in-suite core-tests)
 
-(test downcase-word
-  (with-drei-environment ()
-    (downcase-word (point) (current-syntax) 1)
-    (is (string= (buffer-contents) "")))
-  (with-drei-environment (:initial-contents "CLI MA CS CLIMACS")
-    (let ((m (clone-mark (point) :right)))
-      (setf (offset m) 0)
-      (downcase-word m (current-syntax) 3)
-      (is (string= (buffer-contents)
-                   "cli ma cs CLIMACS"))
-      (is (= (offset m) 9)))))
-
-(test upcase-word
-  (with-drei-environment ()
-    (upcase-word (point) (current-syntax) 1)
-    (is (string= (buffer-contents) "")))
-  (with-drei-environment (:initial-contents "cli ma cs climacs")
-    (let ((m (clone-mark (point) :right)))
-      (setf (offset m) 0)
-      (upcase-word m (current-syntax) 3)
-      (is (string= (buffer-contents)
-                   "CLI MA CS climacs"))
-      (is (= (offset m) 9)))))
-
-(test capitalize-word
-  (with-drei-environment ()
-    (capitalize-word (point) (current-syntax) 1)
-    (is (string= (buffer-contents) "")))
-  (with-drei-environment ( :initial-contents "cli ma cs climacs")
-    (let ((m (clone-mark (point) :right)))
-      (setf (offset m) 0)
-      (capitalize-word m (current-syntax) 3)
-      (is (string= (buffer-contents)
-                   "Cli Ma Cs climacs"))
-      (is (= (offset m) 9)))))
-
 (test possibly-fill-line
   (with-drei-environment ()
     (possibly-fill-line)
@@ -191,6 +155,9 @@
     (buffer-is "FOO BAR")))
 
 (test downcase-word
+  (with-drei-environment ()
+    (downcase-word (point) (current-syntax) 1)
+    (is (string= (buffer-contents) "")))
   (with-drei-environment (:initial-contents "Drei Climacs Drei")
     (downcase-word (point) (current-syntax) 1)
     (buffer-is "drei Climacs Drei")
@@ -206,9 +173,16 @@
     (buffer-is "drei climacs Drei"))
   (with-drei-environment (:initial-contents "Drei Climacs Drei")
     (downcase-word (point) (current-syntax) 3)
-    (buffer-is "drei climacs drei")))
+    (buffer-is "drei climacs drei"))
+  (with-drei-environment (:initial-contents "CLI MA CS CLIMACS")
+    (downcase-word (point) (current-syntax) 3)
+    (is (buffer-is "cli ma cs CLIMACS"))
+    (is (= 9 (offset (point))))))
 
 (test upcase-word
+  (with-drei-environment ()
+    (upcase-word (point) (current-syntax) 1)
+    (is (string= (buffer-contents) "")))
   (with-drei-environment (:initial-contents "Drei Climacs Drei")
     (upcase-word (point) (current-syntax) 1)
     (buffer-is "DREI Climacs Drei")
@@ -224,9 +198,19 @@
     (buffer-is "DREI CLIMACS Drei"))
   (with-drei-environment (:initial-contents "Drei Climacs Drei")
     (upcase-word (point) (current-syntax) 3)
-    (buffer-is "DREI CLIMACS DREI")))
+    (buffer-is "DREI CLIMACS DREI"))
+  (with-drei-environment (:initial-contents "cli ma cs climacs")
+    (let ((m (clone-mark (point) :right)))
+      (setf (offset m) 0)
+      (upcase-word m (current-syntax) 3)
+      (is (string= (buffer-contents)
+                   "CLI MA CS climacs"))
+      (is (= (offset m) 9)))))
 
 (test capitalize-word
+  (with-drei-environment ()
+    (capitalize-word (point) (current-syntax) 1)
+    (is (string= (buffer-contents) "")))
   (with-drei-environment (:initial-contents "drei climacs drei")
     (capitalize-word (point) (current-syntax) 1)
     (buffer-is "Drei climacs drei")
@@ -242,7 +226,14 @@
     (buffer-is "Drei Climacs drei"))
   (with-drei-environment (:initial-contents "drei climacs drei")
     (capitalize-word (point) (current-syntax) 3)
-    (buffer-is "Drei Climacs Drei")))
+    (buffer-is "Drei Climacs Drei"))
+  (with-drei-environment ( :initial-contents "cli ma cs climacs")
+    (let ((m (clone-mark (point) :right)))
+      (setf (offset m) 0)
+      (capitalize-word m (current-syntax) 3)
+      (is (string= (buffer-contents)
+                   "Cli Ma Cs climacs"))
+      (is (= (offset m) 9)))))
 
 (test indent-region
   ;; FIXME: Sadly, we can't test this function, because it requires a




More information about the Mcclim-cvs mailing list