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:
test "report layout" {
assert_snapshot(&"total: 3 items")
}pub(api) fn assert_snapshot<T: Show>(value: &T)Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
value | &T |
Errors
panics when the text differs from the stored snapshot (the first run creates it).
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/testing.oxl:431