expectError (Function)

Signature: expectError(result: Result<t0, t1>, message: t1) -> Unit

Description: Asserts that a Result is an Error with the given message. The Success payload is never rendered, so any Result is accepted.

Parameters

  • result (Result<t0, t1>): The Result expected to have failed
  • message (t1): The Error message it must carry

Returns: Unit

Example

test("overflow", fn() => expectError(checkedMul(4294967296, 4294967296), "integer overflow"))
test ("overflow", \() => expectError (checkedMul (4294967296, 4294967296), "integer overflow"))