aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authorJosef Pospíšil <josef.pospisil@laststar.eu>2021-01-18 12:47:18 +0100
committerJosef Pospíšil <josef.pospisil@laststar.eu>2021-01-18 12:47:18 +0100
commit885765eeebc755f2b4b6e015e5eafadd0f6a14f5 (patch)
tree26371fe8496d7bd4ede4f50a863f438af0d49603 /README.md
parentMerge pull request #13 from MikeBeller/timeit-setstar (diff)
Add simple test helper, extracted from janet-lang
Diffstat (limited to 'README.md')
-rw-r--r--README.md25
1 files changed, 24 insertions, 1 deletions
diff --git a/README.md b/README.md
index c202100..9321fcc 100644
--- a/README.md
+++ b/README.md
@@ -182,6 +182,29 @@ arguments to `argparse`.
Run `(doc argparse/argparse)` after importing for more information.
+## Test
+
+This module contains a simple test helper when you do not need a specialized
+library.
+
+```clojure
+(import spork/test)
+
+(test/start-suite 0)
+
+(test/assert true "is always true")
+(test/assert-error "To err is natural" (error "Bad"))
+(test/assert-no-error "To not err is desired" (do "Good"))
+
+(test/end-suite)
+
+# =>
+
+Test suite 0 finished in 0.000 soconds
+3 of 3 tests passed.
+
+```
+
## Misc
### Dedent
@@ -229,4 +252,4 @@ x => @[3 5]
```
[sudo] jpm install https://github.com/janet-lang/spork.git
-``` \ No newline at end of file
+```