-
Notifications
You must be signed in to change notification settings - Fork 4
/
test-lisp-unit2.lisp
41 lines (34 loc) · 1012 Bytes
/
test-lisp-unit2.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
;; -*- coding: utf-8 -*-
(defpackage :slite/test-lisp-unit2
(:use #:cl
#:fiveam)
(:import-from #:slite
#:test-result-list)
(:import-from #:slite/lisp-unit2
#:fake-test-result)
(:local-nicknames (#:a #:alexandria)
(#:unit #:lisp-unit2)))
(in-package :slite/test-lisp-unit2)
(def-suite* :slite/test-lisp-unit2 :in :slite)
(unit:define-test simple-test
(:tags '(bar))
(unit:assert-eql 1 (- 2 1))
(unit:assert-eql 1 1))
(unit:define-test another-test2
(:tags '(bar))
(unit:assert-eql 1 1)
(unit:assert-eql 2 4))
(unit:define-test error-test
(:tags '(bar))
(error "blah blah"))
;;(unit:run-tests :tags 'bar)
(def-fixture state ()
(let ((*debugger-hook* nil))
(let ((results (test-result-list (unit:run-tests :tags 'bar))))
(&body))))
(test preconditions
(with-fixture state ()
(is (listp results))
(is (eql 5 (length results)))
(loop for x in results
do (is (typep x 'fake-test-result)))))