summaryrefslogtreecommitdiff
path: root/doc/tests/test.md
diff options
context:
space:
mode:
authorAndrey Orst <andreyorst@gmail.com>2021-01-24 16:22:57 +0300
committerAndrey Orst <andreyorst@gmail.com>2021-01-24 18:25:42 +0300
commitb22f270b596881630fb1dbd6a721c1fe6312f00d (patch)
treefc9ac927f79039c67d263b40c6ec73de4a1161a2 /doc/tests/test.md
parent996b6b2b199610682d32028e02e5c07f781e5373 (diff)
feature: include documentation testing in pipeline
Diffstat (limited to 'doc/tests/test.md')
-rw-r--r--doc/tests/test.md41
1 files changed, 20 insertions, 21 deletions
diff --git a/doc/tests/test.md b/doc/tests/test.md
index 8a6c7e5..f9d8ae9 100644
--- a/doc/tests/test.md
+++ b/doc/tests/test.md
@@ -16,7 +16,7 @@ Function signature:
(deftest name ...)
```
-Simple way of grouping tests.
+Simple way of grouping tests with `name`.
## `testing`
Function signature:
@@ -25,7 +25,7 @@ Function signature:
(testing description ...)
```
-Print test description and run it.
+Print test `description` and run it.
## `assert-eq`
Function signature:
@@ -34,30 +34,26 @@ Function signature:
(assert-eq expr1 expr2 msg)
```
-Like `assert`, except compares results of two expressions on equality.
+Like `assert`, except compares results of `expr1` and `expr2` for equality.
Generates formatted message if `msg` is not set to other message.
### Example
Compare two expressions:
``` fennel
->> (assert-eq 1 (+1 1))
-runtime error: equality assertion failed
- Left: 1
- Right: 3
+;; (assert-eq 1 (+1 1))
+;; => runtime error: equality assertion failed
+;; => Left: 1
+;; => Right: 3
```
Deep compare values:
``` fennel
->> (assert-eq [1 {[2 3] [4 5 6]}] [1 {[2 3] [4 5]}])
-runtime error: equality assertion failed
- Left: [1 {
- [2 3] [4 5 6]
- }]
- Right: [1 {
- [2 3] [4 5]
- }]
+;; (assert-eq [1 {[2 3] [4 5 6]}] [1 {[2 3] [4 5]}])
+;; => runtime error: equality assertion failed
+;; => Left: [1 {[2 3] [4 5 6]}]
+;; => Right: [1 {[2 3] [4 5]}]
```
## `assert-ne`
@@ -67,7 +63,9 @@ Function signature:
(assert-ne expr1 expr2 msg)
```
-Assert for unequality. Same as [`assert-eq`](#assert-eq).
+Assert for unequality. Like `assert`, except compares results of
+`expr1` and `expr2` for equality. Generates formatted message if
+`msg` is not set to other message. Same as [`assert-eq`](#assert-eq).
## `assert-is`
Function signature:
@@ -76,12 +74,12 @@ Function signature:
(assert-is expr msg)
```
-Assert for truth. Same as inbuilt `assert`, except generates more
+Assert `expr` for truth. Same as inbuilt `assert`, except generates more
verbose message if `msg` is not set.
``` fennel
->> (assert-is (= 1 2 3))
-runtime error: assertion failed for (= 1 2 3)
+;; (assert-is (= 1 2 3))
+;; => runtime error: assertion failed for (= 1 2 3)
```
## `assert-not`
@@ -91,8 +89,9 @@ Function signature:
(assert-not expr msg)
```
-Assert for not truth. Works the same as [`assert-is`](#assert-is).
+Assert `expr` for not truth. Generates more verbose message if
+ `msg` is not set. Works the same as [`assert-is`](#assert-is).
-<!-- Generated with Fenneldoc 0.0.7
+<!-- Generated with Fenneldoc 0.1.0
https://gitlab.com/andreyorst/fenneldoc -->