[cl-utilities-cvs] CVS update: cl-utilities/test.lisp

Peter Scott pscott at common-lisp.net
Tue May 10 19:46:42 UTC 2005


Update of /project/cl-utilities/cvsroot/cl-utilities
In directory common-lisp.net:/tmp/cvs-serv5591

Modified Files:
	test.lisp 
Log Message:
Added EVAL-WHEN to make things work better, de-stupidified the COMPOSE
unit tests and added a new one.

Date: Tue May 10 21:46:40 2005
Author: pscott

Index: cl-utilities/test.lisp
diff -u cl-utilities/test.lisp:1.3 cl-utilities/test.lisp:1.4
--- cl-utilities/test.lisp:1.3	Mon May  9 23:53:33 2005
+++ cl-utilities/test.lisp	Tue May 10 21:46:38 2005
@@ -1,6 +1,7 @@
 ;; This file requires the FiveAM unit testing framework.
-(asdf:oos 'asdf:load-op :fiveam)
-(asdf:oos 'asdf:load-op :cl-utilities)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (asdf:oos 'asdf:load-op :fiveam)
+  (asdf:oos 'asdf:load-op :cl-utilities))
 
 ;; To run all the tests:
 ;; (5am:run! 'cl-utilities-tests::cl-utilities-suite)
@@ -120,5 +121,11 @@
 (test compose
   (labels ((2* (x) (* 2 x)))
     (is (= (funcall (compose #'1+ #'1+) 1) 3))
-    (is (= (funcall (compose '1+ '2*) 5) 11))
-    (is (= (funcall (compose #'1+ '2* '1+) 6) 15))))
\ No newline at end of file
+    (is (= (funcall (compose '1+ #'2*) 5) 11))
+    (is (= (funcall (compose #'1+ #'2* '1+) 6) 15))
+    ;; This should signal an undefined function error, since we're
+    ;; using '2* rather than #'2*, which means that COMPOSE will use
+    ;; the dynamic binding at the time it is called rather than the
+    ;; lexical binding here.
+    (signals undefined-function
+	     (= (funcall (compose #'1+ '2* '1+) 6) 15))))
\ No newline at end of file




More information about the Cl-utilities-cvs mailing list