-
Notifications
You must be signed in to change notification settings - Fork 2
Directive
An error that can be thrown from a test to reinterpret its outcome.
public enum DirectiveFrom the TAP specification:
Directives are special notes that follow a # on the test line. Only two are currently defined:
TODOandSKIP. Note that these two keywords are not case-sensitive.
Error
Indicates that a test isn't expected to pass.
case todo(explanation: String? = nil)From the TAP v13 specification:
TODO tests
If the directive starts with
# TODO, the test is counted as a todo test, and the text afterTODOis the explanation.
not ok 13 # TODO bend space and timeNote that if the
TODOhas an explanation it must be separated fromTODOby a space. These tests represent a feature to be implemented or a bug to be fixed and act as something of an executable “things to do” list. They are not expected to succeed. Should a todo test point begin succeeding, the harness should report it as a bonus. This indicates that whatever you were supposed to do has been done and you should promote this to a normal test point.
Indicates that a test should be skipped.
case skip(explanation: String? = nil)From the TAP v13 specification:
If the directive starts with
# SKIP, the test is counted as having been skipped. If the whole test file succeeds, the count of skipped tests is included in the generated output. The harness should report the text after# SKIP\S*\s+as a reason for skipping.
ok 23 # skip Insufficient flogiston pressure.Similarly, one can include an explanation in a plan line, emitted if the test file is skipped completely:
1..0 # Skipped: WWW::Mechanize not installed
Generated at 2021-01-08T14:13:00+0000 using swift-doc 1.0.0-beta.5.