Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Try use FiveAM which is a test framework for Common Lisp.
;;(ql:quickload :fiveam)
(require :fiveam)
(defpackage try-fiveam
(:use :cl)
(:import-from :fiveam test run run! def-suite is))
(in-package try-fiveam)
(test test+
(is (= 2 (+ 1 1)))
(is (not (= 2 (+ 2 2)))))
(run!' test+)
(def-suite a-suite)
(def-suite b-suite :in a-suite)
(def-suite c-suite :in a-suite)
(fiveam:in-suite a-suite)
(test test*
(is (= 1 (* 1 1)))
(is (= 4 (* 2 2))))
(test test-
(is (= 0 (- 1 1))))
(fiveam:in-suite b-suite)
(test test-format
(is (string= "Hello World"
(format nil "Hello World"))))
(run! 'a-suite)
(fiveam:run-all-tests)
@lagagain

This comment has been minimized.

Copy link
Owner Author

@lagagain lagagain commented Nov 28, 2018

all output

Running test TEST+ ..
 Did 2 checks.
    Pass: 2 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)


Running test suite A-SUITE
 Running test suite B-SUITE
  Running test TEST-FORMAT .
 Running test suite C-SUITE
 Running test TEST* ..
 Running test TEST- .
 Did 4 checks.
    Pass: 4 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)


Running test suite NIL
 Running test TEST+ ..
Running test suite A-SUITE
 Running test suite B-SUITE
  Running test TEST-FORMAT .
 Running test suite C-SUITE
 Running test TEST* ..
 Running test TEST- .
 Did 6 checks.
    Pass: 6 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)

(run! test+)

Running test TEST+ ..
 Did 2 checks.
    Pass: 2 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)

(run! 'a-suite)

Running test suite A-SUITE
 Running test suite B-SUITE
  Running test TEST-FORMAT .
 Running test suite C-SUITE
 Running test TEST* ..
 Running test TEST- .
 Did 4 checks.
    Pass: 4 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)

(fiveam:run-all-tests)

Running test suite NIL
 Running test TEST+ ..
Running test suite A-SUITE
 Running test suite B-SUITE
  Running test TEST-FORMAT .
 Running test suite C-SUITE
 Running test TEST* ..
 Running test TEST- .
 Did 6 checks.
    Pass: 6 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.