common-lisp Using FiveAM


Example

Loading the library

(ql:quickload "fiveam")

Define a test case

(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))))

Run tests

(fiveam:run!)

which reports

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

Notes

  • Tests are grouped by test-suites
  • By defaults tests are added to the global test-suite