-
Notifications
You must be signed in to change notification settings - Fork 86
unit test
Matthias Görges edited this page Oct 15, 2016
·
1 revision
#(unit-test n . x) unit-test runs or adds a unit test depending on the arguments
Parameter | Description |
---|---|
n | Unit test name |
x | Optional: Unit test declaration (description and test) |
Note: When defining a new unit test two arguments needs to be specified:
a) A short unit-test description, and b) an anonymous function returning #t
when successfully passing the test.
Example 1: Define a unit test for "Matrix value lookup"
(unit-test "listlist-ref" "Matrix value lookup"
(lambda () (and
(equal? (listlist-ref '((4 7) (2 6)) 0 0) 4)
(equal? (listlist-ref '((4 7) (2 6)) 1 1) 6)
(equal? (listlist-ref '((1 2 3)) 0 1) 2)
(equal? (listlist-ref '((1 2 3) (4 5 6) (7 8 9)) 0 2) 3)
(equal? (listlist-ref '((1 2 3) (4 5 6) (7 8 9)) 2 0) 7)
)))
Example 2: Run a specific unit test for "Matrix value lookup" in a REPL
> (unit-test "listlist-ref")
#t
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip