diff --git a/docs/clean.svg b/docs/clean.svg
index 551caba..cf12a15 100644
--- a/docs/clean.svg
+++ b/docs/clean.svg
@@ -43,5 +43,5 @@
-
+
\ No newline at end of file
diff --git a/docs/demo.svg b/docs/demo.svg
index 07c0309..502f150 100644
--- a/docs/demo.svg
+++ b/docs/demo.svg
@@ -43,5 +43,5 @@
-
+
\ No newline at end of file
diff --git a/examples/balls.nim b/examples/balls.nim
index 5ad4cd5..973a9cf 100644
--- a/examples/balls.nim
+++ b/examples/balls.nim
@@ -29,7 +29,7 @@ testes:
block:
## check a list of statements in a block
- check:
+ check "r should be 4":
r < 5
r > 3
diff --git a/testes.nim b/testes.nim
index d324b8d..cb35b16 100644
--- a/testes.nim
+++ b/testes.nim
@@ -236,16 +236,21 @@ proc checkOne(condition: NimNode; message: NimNode): NimNode =
newCall(ident"newException", assertion, message)
result = newIfStmt (newCall(ident"not", condition), clause)
-macro check*(body: untyped; message = "") =
- ## Check one or more expressions (in a block); raises an AssertionDefect
- ## in the event that the expression is `false` regardless of `assertions`
- ## settings. Optionally specify a custom message a la `assert`.
- if body.kind == nnkStmtList:
- result = newStmtList()
- for child in body.items:
- result.add: checkOne(child, message)
- else:
- result = checkOne(body, message)
+macro check*(body: bool; message: string = "") =
+ ## Check a single expression; raises an AssertionDefect in the event
+ ## that the expression is `false` regardless of `assertions` settings.
+ ## Specify a custom `message` a la `assert`.
+ result = checkOne(body, message)
+
+macro check*(message: string; body: untyped) =
+ ## Check one or more expressions in a block; raises an AssertionDefect
+ ## in the event that an expression is `false` regardless of `assertions`
+ ## settings. Specify a custom `message` a la `assert`.
+ body.expectKind nnkStmtList
+ result = newStmtList()
+ for child in body.items:
+ result.add:
+ newCall(bindSym"check", child, message)
proc `status=`(t: var Test; s: StatusKind) {.used.} =
system.`=`(t.status, max(t.status, s))
diff --git a/testes.nimble b/testes.nimble
index 8e8ab8e..60fe1d5 100644
--- a/testes.nimble
+++ b/testes.nimble
@@ -1,8 +1,8 @@
-version = "0.10.0"
+version = "1.0.0"
author = "disruptek"
description = "a cure for salty testes"
license = "MIT"
-requires "nim >= 1.0.4"
+
#requires "cligen >= 0.9.41 & <= 0.9.45"
#requires "bump >= 1.8.18 & < 2.0.0"
requires "https://github.com/disruptek/grok >= 0.0.4 & < 1.0.0"
diff --git a/tests/testicles.nim b/tests/testicles.nim
index 01a2cf9..0961844 100644
--- a/tests/testicles.nim
+++ b/tests/testicles.nim
@@ -26,7 +26,7 @@ suite "a pretty suite shim":
block:
## check a list of statements in a block
- check:
+ check "something failed":
r < 5
r > 3