gdDocumentation0.8.0

API reference

GDTestCheck

Checker collecting assert counts and failures and producing the test exit code.

Properties

failures : int
count : int

Methods

eq

eq(got: Variant, want: Variant, label: String = "") -> void

Assert that two values are equal.

Parameters

NameTypeDefaultDescription
gotVariantRequiredActual value produced by the operation under test.
wantVariantRequiredExpected value for the assertion.
labelString""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 = "") -> void

Assert that two values differ.

Parameters

NameTypeDefaultDescription
gotVariantRequiredActual value produced by the operation under test.
otherVariantRequiredValue that the actual result must differ from.
labelString""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 = "") -> void

Assert that a condition is true.

Parameters

NameTypeDefaultDescription
condboolRequiredCondition whose truth value is checked.
labelString""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 = "") -> void

Assert that a condition is false.

Parameters

NameTypeDefaultDescription
condboolRequiredCondition whose truth value is checked.
labelString""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 = "") -> void

Assert that two numbers differ by no more than the tolerance.

Parameters

NameTypeDefaultDescription
gotfloatRequiredActual value produced by the operation under test.
wantfloatRequiredExpected value for the assertion.
slackfloat0.000000001Allowed absolute difference when comparing numeric values.
labelString""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 = "") -> void

Assert that a collection contains the requested value.

Parameters

NameTypeDefaultDescription
boxVariantRequiredContainer searched for the expected item.
itemVariantRequiredItem to inspect or the item rule applied to collection elements.
labelString""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 = "") -> void

Assert that an operation returned no error.

Parameters

NameTypeDefaultDescription
errorErrRequiredError value to classify when choosing an HTTP status.
labelString""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 = "") -> void

Assert a failure against a shared category value.

Parameters

NameTypeDefaultDescription
errorErrRequiredError value to classify when choosing an HTTP status.
kindErrnullError kind used for classification and matching.
labelString""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() -> int

Return 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() -> void

Print 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.