API reference
GDTestCheck
Checker collecting assert counts and failures and producing the test exit code.
Properties
failures: intcount: int
Methods
eq(got: Variant, want: Variant, label: String = "") -> voidne(got: Variant, other: Variant, label: String = "") -> voidok(cond: bool, label: String = "") -> voidno(cond: bool, label: String = "") -> voidnear(got: float, want: float, slack: float = 0.000000001, label: String = "") -> voidhas(box: Variant, item: Variant, label: String = "") -> voidsucceeds(error: Err, label: String = "") -> voidfails(error: Err, kind: Err = null, label: String = "") -> voidcode() -> intreport() -> void
eq
eq(got: Variant, want: Variant, label: String = "") -> voidAssert that two values are equal.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
got | Variant | Required | Actual value produced by the operation under test. |
want | Variant | Required | Expected value for the assertion. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
ne
ne(got: Variant, other: Variant, label: String = "") -> voidAssert that two values differ.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
got | Variant | Required | Actual value produced by the operation under test. |
other | Variant | Required | Value that the actual result must differ from. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
ok
ok(cond: bool, label: String = "") -> voidAssert that a condition is true.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cond | bool | Required | Condition whose truth value is checked. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
no
no(cond: bool, label: String = "") -> voidAssert that a condition is false.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cond | bool | Required | Condition whose truth value is checked. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
near
near(got: float, want: float, slack: float = 0.000000001, label: String = "") -> voidAssert that two numbers differ by no more than the tolerance.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
got | float | Required | Actual value produced by the operation under test. |
want | float | Required | Expected value for the assertion. |
slack | float | 0.000000001 | Allowed absolute difference when comparing numeric values. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
has
has(box: Variant, item: Variant, label: String = "") -> voidAssert that a collection contains the requested value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
box | Variant | Required | Container searched for the expected item. |
item | Variant | Required | Item to inspect or the item rule applied to collection elements. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
succeeds
succeeds(error: Err, label: String = "") -> voidAssert that an operation returned no error.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
error | Err | Required | Error value to classify when choosing an HTTP status. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
fails
fails(error: Err, kind: Err = null, label: String = "") -> voidAssert a failure against a shared category value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
error | Err | Required | Error value to classify when choosing an HTTP status. |
kind | Err | null | Error kind used for classification and matching. |
label | String | "" | Message identifying this assertion in the test report. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
code
code() -> intReturn the test exit code.
Parameters
No parameters.
Return value
int
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
report
report() -> voidPrint a one-line summary.
Parameters
No parameters.
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.