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:
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
Параметры
| Имя | Тип |
|---|---|
why | str |
Возвращает
never
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/testing.oxl:236