forked from defaultxr/cl-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.lisp
46 lines (37 loc) · 1.61 KB
/
test.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
;;;; t/test.lisp - basic tests and test utilities/fixtures/etc for the cl-patterns test suite.
(defpackage #:cl-patterns/tests
(:use #:cl
#:cl-patterns
#:alexandria
#:mutility
#:fiveam))
(in-package #:cl-patterns/tests)
(def-suite cl-patterns-tests
:description "cl-patterns tests suite.")
(in-suite cl-patterns-tests)
(def-fixture debug-backend-and-clock (&rest clock-args)
"Temporarily set the backend and clock for testing."
(let ((cl-patterns::*backends* (list (make-backend 'debug-backend)))
(*clock* (apply #'make-clock clock-args)))
(debug-backend-clear-recent-events)
(&body)
(debug-backend-clear-recent-events)))
(def-fixture temporary-pdef-dictionary ()
"Temporarily create a new pdef dictionary for testing."
(let ((cl-patterns::*pdef-dictionary* (make-hash-table)))
(&body)))
(test system-attributes
"Check that the system has all the standard attributes"
(let ((missing (system-missing-attributes '#:cl-patterns)))
(is-false missing
"The system definition is missing attributes: ~S" missing)))
(test undocumented-symbols
"Check for any undocumented exported symbols"
(let ((undocumented (package-undocumented-symbols '#:cl-patterns)))
(is-false undocumented
"some exported symbols do not have docstrings: ~S" undocumented)))
(test docstrings-broken-links
"Check for any broken links in docstrings of exported symbols"
(let ((symbols (package-docstrings-with-broken-links '#:cl-patterns)))
(is-false symbols
"some exported symbols have docstrings that contain broken links: ~S" symbols)))