expectOk<T> function

T expectOk<T>(
  1. Result<T> actual
)

Requires actual to be Ok and returns its value for further assertions.

Implementation

T expectOk<T>(Result<T> actual) => switch (actual) {
  Ok<T>(:final value) => value,
  Err<T>(:final problem) => throw TestHelperFailure(
    'Expected Ok, got Err carrying $problem.',
  ),
};