balls

Source   Edit  

Procs

proc checkpoint(ss: varargs[string, `$`]) {....raises: [IOError],
    tags: [WriteIOEffect], forbids: [].}
Like echo, but outputs to stdmsg() with the other test output. Source   Edit  
proc fail(msg = "failed") {....raises: [FailError], tags: [], forbids: [].}
Manually fails the current test. Source   Edit  
proc skip(msg = "skipped") {....raises: [SkipError], tags: [], forbids: [].}
Manually skips the remainder of the current test. Source   Edit  

Macros

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. Source   Edit  
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. Source   Edit  
macro report(ss: varargs[typed])
Like checkpoint, but rendered as a comment. You can supply AST here to be typed and rendered via treeRepr. Source   Edit  
macro suite(name: string; tests: untyped)
Put each test in a block: underneath the named suite. You can specify test names using ## comment statements, or block syntax like that of unittests: test "my test name": check true Source   Edit  
macro test(name: string; body: untyped)
A compatibility shim for adapting std/unittest syntax. Source   Edit  

Templates

template expect(exception: typed; body: untyped)
Fails the test if an expected exception is not raised in the body. Source   Edit  
template skip(msg = "skipped"; body: untyped)
Manually skips the remainder of the current test and stops macro processing. Source   Edit