Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lambdabaa/lunit
A lightweight Lisp unit testing library. This is... a work in progress.
https://github.com/lambdabaa/lunit
Last synced: 7 days ago
JSON representation
A lightweight Lisp unit testing library. This is... a work in progress.
- Host: GitHub
- URL: https://github.com/lambdabaa/lunit
- Owner: lambdabaa
- Created: 2015-04-12T05:30:38.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-13T04:42:04.000Z (over 9 years ago)
- Last Synced: 2024-11-09T11:44:48.782Z (2 months ago)
- Language: Common Lisp
- Homepage:
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
lunit
=====A lightweight Lisp unit testing library. This is... a work in progress.
### Example
```lisp
(load (merge-pathnames "fixtures/calculator" *load-truename*))
(use-package :calculator)
(load (merge-pathnames "../src/lunit" *load-truename*))
(use-package :lunit)(create-suite "calculator" (lambda (suite)
(setup suite (lambda ()
(calculator:reset)
))(test suite "should add correctly" (lambda ()
(assert (= 0 (calculator:value)))
(calculator:add 5)
(assert (= 5 (calculator:value)))
(calculator:add 5)
(assert (= 10 (calculator:value)))
))(test suite "reset should set accumulator to 0" (lambda ()
(assert (= 0 (calculator:value)))
(calculator:add 2)
(assert (/= 0 (calculator:value)))
(calculator:reset)
(assert (= 0 (calculator:value)))
))(test suite "assertion fail" (lambda ()
(assert (= 1 (calculator:value)))
))
))
```