septeql

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

run-tests.lisp (674B)


      1 (in-package :septeql)
      2 
      3 (defun do-tests (&optional verbose)
      4   (with-open-file (stream *tests-file*)
      5     (let ((failed nil))
      6       (loop
      7        (let* ((eof (gensym))
      8 	      (*package* #.*package*)
      9 	      (send (read stream nil eof))
     10 	      (expect (read stream nil eof)))
     11 	 (when (eql send eof) (return failed))
     12 	 (let* ((actual (eval send))
     13 		(summary (list :sent send :expected expect :got actual)))
     14 	   (cond ((equal actual expect)
     15 		  (when verbose
     16 		    (format *trace-output* "OK    ~A~%   => ~A~%" 
     17 			    send expect)))
     18 		 (t
     19 		  (when verbose
     20 		    (format *trace-output* "NOT   ~A~%   => ~A~%  got ~A~%"
     21 			    send expect actual))
     22 		  (push summary failed)))))))))