OxL Справочник OxL
РусскийEnglish

fn oxlMockUnmatched

A call no arm of the mock matches (or an arm whose responses are used up): the test fails with the call (§18.3); the caller of the rpc sees an internal error.

Example:

oxl✓ проверяется в CI
service Ledger {
  @public rpc note(n: i64) -> i64
}

impl Ledger {
  rpc note(n) => n
}

// a call no arm matches (here `note(2)`) fails the test; the arm below answers `note(1)`
test "the expected call is answered" {
  mock Ledger {
    note(1) => 1
  }
  assert_eq(Ledger.note(1)!, 1)
}
pub(api) fn oxlMockUnmatched(why: str) -> never

С версии. 1.0.0-beta

Параметры

ИмяТип
whystr

Возвращает

never

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/testing.oxl:236

См. также