使用 FiveAM
載入庫
(ql:quickload "fiveam")
定義測試用例
(fiveam:test sum-1
(fiveam:is (= 3 (+ 1 2))))
;; We'll also add a failing test case
(fiveam:test sum2
(fiveam:is (= 4 (+ 1 2))))
執行測試
(fiveam:run!)
報道
Running test suite NIL
Running test SUM2 f
Running test SUM1 .
Did 2 checks.
Pass: 1 (50%)
Skip: 0 ( 0%)
Fail: 1 (50%)
Failure Details:
--------------------------------
SUM2 []:
(+ 1 2)
evaluated to
3
which is not
=
to
4
..
--------------------------------
NIL
筆記
- 測試按測試套件分組
- 預設情況下,測試會新增到全域性測試套件中