Author: | Zahary Karadjov |
---|
This module implements boilerplate to make testing easy.
Example:
suite "description for this stuff": test "essential truths": # give up and stop if this fails require(true) test "slightly less obvious stuff": # print a nasty message and move on, skipping # the remainder of this block check(1 != 1) check("asd"[2] == 'd') test "out of bounds error is thrown on bad access": let v = @[1, 2, 3] # you can do initialization here expect(IndexError): discard v[4]Reading settings
Templates
template testSetupIMPL(): stmt {.immediate, dirty.}
- Source
template testTeardownIMPL(): stmt {.immediate, dirty.}
- Source
template suite(name: expr; body: stmt): stmt {.immediate, dirty.}
- Source
template test(name: expr; body: stmt): stmt {.immediate, dirty.}
- Source
template fail()
- Source
template require(conditions: stmt): stmt {.immediate, dirty.}
- Source