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

fn assert_snapshot

Compares {value} with the snapshot of this test in snapshots/ (§18.2, D-7080); oxl test --update-snapshots rewrites it. Borrows the value (D-7421: the interpolation of a borrowed generic &T no longer drops it, D-7420).

Example:

oxl✓ проверяется в CI
test "report layout" {
  assert_snapshot(&"total: 3 items")
}
pub(api) fn assert_snapshot<T: Show>(value: &T)

С версии. 1.0.0-beta

Параметры

ИмяТип
value&T

Ошибки

panics when the text differs from the stored snapshot (the first run creates it).

Эффекты

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

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

См. также