26 lines
629 B
Common Lisp
26 lines
629 B
Common Lisp
;;; cl-scopes/testing
|
|
|
|
;;;; simple testing library
|
|
|
|
(defpackage :scopes/testing
|
|
(:use :common-lisp)
|
|
(:export #:*test-suite*
|
|
#:test-suite #:show-result
|
|
#:==))
|
|
|
|
(in-package :scopes/testing)
|
|
|
|
(defvar *test-suite* nil)
|
|
|
|
(defclass test-suite ()
|
|
((name :reader name :initform "test" :initarg :name)
|
|
(result :accessor result :initform nil)))
|
|
|
|
(defun test-suite (&optional (name "test"))
|
|
(make-instance 'test-suite :name name))
|
|
|
|
(defun show-result ()
|
|
(format t "~a, result: ~a~%" (name *test-suite*) (result *test-suite*)))
|
|
|
|
(defun == (have wanted)
|
|
(push (equalp have wanted) (result *test-suite*)))
|