Library expect

To use this library in your code:

import expect
Utilities for expressing expectations in tests.

Functions

expect [condition] -> none
Expects the given condition to evaluate to true.

expect condition/bool --message/string=null -> none
Expects the given condition to be true.
Otherwise reports an error (using the provided message, if given) and exits the program.

expect-bytes-equal expected/ByteArray actual/ByteArray -> none
Expects the actual byte array to be equal to the expected byte array.

expect-equals expected/any actual/any -> none
Expects actual to be equal to expected.

expect-identical expected/any actual/any -> none
Expects actual to be identical to expected.

expect-list-equals expected/List actual/List -> none
Expects the actual list to be equal to the expected list.

expect-no-throw [no-throw-block] -> none
Expects no-throw-block to not throw.

expect-not condition/bool --message/string=null -> none
Expects the given condition to be false.
Otherwise reports an error (using the provided message, if given) and exits the program.

expect-not-equals unexpected/any actual/any -> none
Expects actual not to be equal to unexpected.

expect-not-identical unexpected/any actual/any -> none
Expects actual not to be identical to unexpected.

expect-not-null actual/any -> none
Expects actual to be not null.

expect-null actual/any -> none
Expects actual to be equal to null.

expect-structural-equals expected/Object actual/Object -> none
Expects the actual object to be structurally equal to the expected object.
Understands operator equality and memberwise structural equality of lists and maps.

expect-throw expected/any [throw-block] -> none
Expects throw-block to throw an object equal to the expected value.